Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b20c7fb
Initial Commit
runcows Nov 24, 2024
85a3579
Refactor to only summon displays as they are used.
runcows Nov 27, 2024
884bc5c
Added main types
runcows Nov 27, 2024
6488bd1
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Nov 28, 2024
b85c91a
slight corrections in set_storages
runcows Nov 28, 2024
a756fc1
Edit raycasts to use player.block_interaction_range
runcows Nov 28, 2024
25f2d10
Added overlay for block_interaction_range since mojang removed the pl…
runcows Nov 28, 2024
43398e1
Cleaning up some comments
runcows Nov 28, 2024
669528f
Remove overlay because I didn't need to do it at all
runcows Nov 29, 2024
0a18491
Removed stages and plantables talked about in meeting. Still need to …
runcows Dec 1, 2024
3f42c46
Fix decorated pot plants not initializing when more items than stages
runcows Dec 2, 2024
0d1e89f
Changes to plantables as discussed
runcows Dec 7, 2024
4b10837
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Dec 7, 2024
30340bf
Added overlay for 1.21.4 and changed storage version_history array to…
runcows Dec 7, 2024
e2aab6e
Fix decorated pot temp marker not being removed when pot is empty
runcows Dec 10, 2024
3f5955f
Simplify block interaction range raycast range to not need scoreboard…
runcows Dec 10, 2024
8d0e9ff
Changes from Bloo's comments
runcows Dec 10, 2024
7ce25a8
Adding icon
runcows Dec 10, 2024
d5a1a67
Fixing my new entry in contributors.json not being inserted alphabeti…
runcows Dec 10, 2024
f55f575
Remove cocoa beans from README
runcows Dec 10, 2024
8de3e09
Fix break and replace partial plant cannibalizing
runcows Dec 11, 2024
002d60c
Fix plant rotation not being locked for newly summoned displays of a …
runcows Dec 11, 2024
da4351a
Implement Bloo's suggestion for in_pot changes to not need to select …
runcows Dec 11, 2024
63a4bf3
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Dec 12, 2024
a897a52
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Dec 16, 2024
9556ff8
Add webp animation (20fps, compressed to 351 KB)
runcows Dec 25, 2024
a2035fb
Change my contributors.json link to bluesky for upcoming changes
runcows Dec 25, 2024
542d9b0
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Dec 25, 2024
9ae9e04
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Jan 6, 2025
7db3bcb
Update header of gm4_blossoming_pots/data/gm4_blossoming_pots/functio…
runcows Jan 19, 2025
8b19a34
Change function header "with" lines to follow the style bloo specifie…
runcows Jan 19, 2025
dad1bd0
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Jan 19, 2025
06ed2ae
Change as_player -> as marker selectors to limit 1
runcows Jan 19, 2025
bd40b5b
Change player rotation data to use storage instead of marker data
runcows Jan 21, 2025
b5e4698
Fix empty hand scenario being overlooked by player rotation changes
runcows Jan 22, 2025
4127daf
Change empty hand interact on flower pot to summon an item at players…
runcows Jan 22, 2025
ebff299
Assorted changes from review session
runcows Feb 1, 2025
a07dd26
Rename advancements
runcows Feb 1, 2025
eae18a5
Refactor vanilla flower pot handling
runcows Feb 1, 2025
362ba7c
Comments on potential changes
runcows Feb 1, 2025
6db62ad
Refactor decorated pot handling
runcows Feb 1, 2025
1c81619
Rename vanilla_pot_handling/in_pot
runcows Feb 1, 2025
5331209
Refactor flower pot handling
runcows Feb 1, 2025
9822155
Function header changes
runcows Feb 1, 2025
8100f28
Change distance range to be self consistent with module
runcows Feb 1, 2025
264108e
Condense flower pot clean up
runcows Feb 1, 2025
4c96a48
Combine like selectors into one function
runcows Feb 1, 2025
b02c00e
Comment format change
runcows Feb 1, 2025
bdcf7d9
Fix temp storage not being reset
runcows Feb 2, 2025
ff1b1c9
Remove player nbt UUID check
runcows Feb 2, 2025
0fdcddc
Fix issues from changes
runcows Feb 2, 2025
c698378
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Feb 6, 2025
0eba8db
Wrap marker data in gm4_blossoming_pots tag
runcows Feb 8, 2025
b282b53
Replace FallDistance stage tracking with Scoreboard
runcows Feb 8, 2025
5f30f5f
Update gm4_blossoming_pots/beet.yaml
runcows Feb 8, 2025
e83f651
Update gm4_blossoming_pots/beet.yaml
runcows Feb 8, 2025
cc83d68
Update gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorate…
runcows Feb 8, 2025
fd7ca5e
Merge branch 'gm4-blossoming-pots-intial' of https://github.com/runco…
runcows Feb 8, 2025
ff074b0
Fix main marker cleanup macro not reflecting change in marker data wr…
runcows Feb 8, 2025
b0f22d5
Fix anchored eyes not moving execution context on first raycast loop
runcows Feb 8, 2025
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
4 changes: 4 additions & 0 deletions gm4/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
"name": "Nik3141",
"links": ["https://youtube.com/channel/UCgKd6elt0L3w-d7ryLw-7HQ"]
},
{
"name": "runcows",
"links": ["https://bsky.app/profile/runcows.bsky.social"]
},
{
"name": "Scommander",
"links": ["https://github.com/Scommander"]
Expand Down
26 changes: 26 additions & 0 deletions gm4_blossoming_pots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Blossoming Pots<!--$headerTitle--><!--$pmc:delete-->

Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style! <!--$pmc:headerSize-->

### Features
- Some plants have multiple different heights or options depending on how many items you put in the pot.
- Directional plants are placed oriented towards you.
- Allows you to plant the following
- All Flowers (including 2 tall)
- All Saplings (including azaleas and propagules)
- All Leaves
- Cactus
- All Fungi
- All Dead / Alive Coral & Coral Fans!
- Nether Roots & Vines
- Tall & Short Grass
- Tall & Short Ferns
- Dead Bush
- All Lush Cave Plants
- Sweet Berry Bush
- Sea Pickle
- Most Seeds
- Netherwart
- Chorus Flowers
- All Amethyst Buds & Clusters
- Dripstone
39 changes: 39 additions & 0 deletions gm4_blossoming_pots/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
id: gm4_blossoming_pots
name: Blossoming Pots
version: 3.1.X

data_pack:
load: .
overlays:
- formats:
min_inclusive: 61
max_inclusive: 61
directory: since_61

resource_pack:
load: .

pipeline:
- gm4.plugins.extend.module

meta:
gm4:
versioning:
schedule_loops: [main]
website:
description: Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style!
recommended: []
notes: []
#modrinth:
#project_id: null
#smithed:
#pack_id: null
planetminecraft:
uid: null
video: null
wiki: https://wiki.gm4.co/wiki/Blossoming_Pots
credits:
Creator:
- runcows
Icon Design:
- runcows
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": [
"minecraft:decorated_pot"
]
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"rewards": {
"function": "gm4_blossoming_pots:decorated/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": [
"minecraft:flower_pot"
]
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"rewards": {
"function": "gm4_blossoming_pots:flower/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": "#gm4_blossoming_pots:potted_plants"
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"rewards": {
"function": "gm4_blossoming_pots:vanilla_pot_handling/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Raycasts for pot the player interacted with, then proceeds if necessary
# @s = player who interacted with a decorated pot
# at @s
# run from advancement gm4_blossoming_pots:interact_with_decorated_pot

# Reset advancement
advancement revoke @s only gm4_blossoming_pots:interact_with_decorated_pot
# Reset temp
data remove storage gm4_blossoming_pots:decorated_pots temp

function gm4_blossoming_pots:decorated/get_player_rotation
# raycast
execute store result score @s gm4_blossoming_pots.range run attribute @s minecraft:block_interaction_range get 200
execute anchored eyes positioned ^ ^ ^ run function gm4_blossoming_pots:decorated/raycast
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Checks if decorated pot has any items inside before trying to instantiate macro
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with {id, count}
# run from decorated/raycast

# kills marker and returns, if pot empty
execute unless data block ~ ~ ~ item run return run kill @s
function gm4_blossoming_pots:decorated/set_count with block ~ ~ ~ item
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Gets player rotation data for later
# @s = player who interacted with a decorated pot
# at @s
# run from decorated/as_player

# player facing west
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
# player facing north
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
# player facing east
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
# player facing south
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Checks the temp markers physical location in the block, to see if it is in the collision box of the decorated pot
# @s = temp marker summoned in parent function
# at @s
# run from decorated/raycast

# merge marker data for if it doesn't get killed
data merge entity @s {Tags:["gm4_blossoming_pots.temp.decorated_pot","smithed.strict","smithed.entity"],CustomName:'{"text":"gm4_blossoming_pots.temp_marker"}'}

# if temp marker in physical hit box, return 1
# dxdydz all 0 bc of MC-123441.
execute at @s align xyz positioned ~0.062499 ~ ~0.062499 if entity @s[dx=0,dy=0,dz=0] \
at @s align xyz positioned ~-0.062499 ~ ~-0.062499 if entity @s[dx=0,dy=0,dz=0] \
run return 1

# else, kill marker, return fail
kill @s
return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Literally just plays sound
# @s = temp marker inside decorated pot
# with {place_sound}
# at @s align xyz positioned ~.5 ~.5 ~.5
# run from decorated/prepare_data

$playsound $(place_sound) block @a[distance=..16] ~ ~ ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Sets up loop for plant stage changes
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with {id, count}
# run from decorated/set_count

# early return if displays are already on desired stage, does not check plant type
$execute if score @e[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot,limit=1] gm4_blossoming_pots.display_stage $(count) run return run kill @s

$execute store result score $array_len gm4_blossoming_pots.loop run data get storage gm4_blossoming_pots:decorated_pots $(id).$(count)

# check how many block displays there are present, if there are more than we need, kill all of them and resummon after. This solves partial display cannibalizing
execute store result score $display_count gm4_blossoming_pots.loop if entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.1]
execute if score $array_len gm4_blossoming_pots.loop < $display_count gm4_blossoming_pots.loop run kill @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.1]

# only use rotation from player if there's no plant there, else overwrite with the plant's rotation value
data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set from entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.1,limit=1] Rotation[0]

# initialize other loop data
execute store result storage gm4_blossoming_pots:decorated_pots temp.score int 1 run scoreboard players set @s gm4_blossoming_pots.loop 0
$data merge storage gm4_blossoming_pots:decorated_pots {temp:{id:"$(id)",count:$(count)}}
$data modify storage gm4_blossoming_pots:decorated_pots temp.data set from storage gm4_blossoming_pots:decorated_pots $(id).$(count)[0]

function gm4_blossoming_pots:decorated/set_displays with storage gm4_blossoming_pots:decorated_pots temp

# play sound
$execute if score @s gm4_blossoming_pots.sound matches 1 \
run function gm4_blossoming_pots:decorated/play_sound with storage gm4_blossoming_pots:decorated_pots $(id)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Main loop for raycasting for the decorated pot the player interacted with
# @s = player who interacted with a decorated pot
# at @s anchored eyes, then marched forward 0.005 over and over
# run from decorated/as_player and self

# if current location is within the decorated pots hit box, summon a temp marker, set its data with the player rotation, and exit raycast
execute if block ~ ~ ~ minecraft:decorated_pot \
summon minecraft:marker if function gm4_blossoming_pots:decorated/in_decorated_pot \
at @s align xyz positioned ~.5 ~.5 ~.5 \
run return run function gm4_blossoming_pots:decorated/check_if_pot_empty

scoreboard players remove @s gm4_blossoming_pots.range 1

# repeat until find decorated pot or out of range
execute if score @s gm4_blossoming_pots.range matches 1.. positioned ^ ^ ^0.005 run function gm4_blossoming_pots:decorated/raycast
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Decides if decorated/prepare_data should use maximum or count
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with {id, count}
# run from decorated/check_if_pot_empty

# early return for unsupported item
$execute unless data storage gm4_blossoming_pots:decorated_pots $(id) run return run kill @s

$execute store result score @s gm4_blossoming_pots.loop run data get storage gm4_blossoming_pots:decorated_pots $(id).maximum
# if pot over maximum use maximum as count
$execute unless score @s gm4_blossoming_pots.loop matches $(count).. \
run data modify storage gm4_blossoming_pots:decorated_pots temp.count set from storage gm4_blossoming_pots:decorated_pots $(id).maximum
# if not, just use count as is
$execute if score @s gm4_blossoming_pots.loop matches $(count).. run data modify storage gm4_blossoming_pots:decorated_pots temp.count set value $(count)

# set id as well
$data merge storage gm4_blossoming_pots:decorated_pots {temp:{id:"$(id)"}}

function gm4_blossoming_pots:decorated/prepare_data with storage gm4_blossoming_pots:decorated_pots temp

kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Main Loop for setting displays to desired stage
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with {rotation, score, id, count, data}
# run from decorated/prepare_data and self

# summon if needed
$execute unless entity @e[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score),limit=1] \
run summon minecraft:block_display ~ ~ ~ {view_range:0.7935f,Tags:["gm4_blossoming_pots.display.decorated_pot","gm4_blossoming_pots.display.decorated_pot.$(score)","smithed.entity"],Rotation:[$(rotation)f,0f]}
# merge data and store the success
$execute store success score @s gm4_blossoming_pots.merge_success \
run data merge entity @e[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score),limit=1] $(data)
# set display_stage score to prevent running the loop when the displays are already on the right stage number
$scoreboard players set @e[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score),limit=1] gm4_blossoming_pots.display_stage $(count)

# if a single merge success set sound to play
execute if score @s gm4_blossoming_pots.merge_success matches 1 run scoreboard players set @s gm4_blossoming_pots.sound 1

# increment score
execute store result storage gm4_blossoming_pots:decorated_pots temp.score int 1 run scoreboard players add @s gm4_blossoming_pots.loop 1

# sets temp.data to next score's data
function gm4_blossoming_pots:decorated/set_temp_data with storage gm4_blossoming_pots:decorated_pots temp
# run again if needed
execute unless score @s gm4_blossoming_pots.loop >= $array_len gm4_blossoming_pots.loop run function gm4_blossoming_pots:decorated/set_displays with storage gm4_blossoming_pots:decorated_pots temp
Loading
Loading