Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 28 additions & 0 deletions gm4_blossoming_pots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 & Coral Blocks!
- Nether Roots & Vines
- Tall & Short Grass
- Tall & Short Ferns
- Dead Bush
- All Lush Cave Plants
- Sweet Berry Bush
- Kelp, Seagrass, Sea Pickle
- All Seeds
- Netherwart
- Cocoa Beans
- Chorus Flowers
- Wheat
- All Amethyst Buds & Clusters
- Dripstone
36 changes: 36 additions & 0 deletions gm4_blossoming_pots/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
id: gm4_blossoming_pots
name: Blossoming Pots
version: 3.0.X
# should I start the version number over for gm4 release?
data_pack:
load: .

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:
- <add notes on version or incompatibilities?>
#modrinth:
#project_id: null
#smithed:
#pack_id: null
planetminecraft:
uid: null
video: null
wiki: null
credits:
Creator:
- runcows
Icon Design:
- <no idea>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": [
"minecraft:flower_pot"
]
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"requirements": [
[
"use_pot"
]
],
"rewards": {
"function": "gm4_blossoming_pots:flower/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": "#gm4_blossoming_pots:potted_plants"
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"requirements": [
[
"use_pot"
]
],
"rewards": {
"function": "gm4_blossoming_pots:flower/vanilla_pots/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"use_pot": {
"conditions": {
"location": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": [
"minecraft:decorated_pot"
]
}
}
}
]
},
"trigger": "minecraft:any_block_use"
}
},
"requirements": [
[
"use_pot"
]
],
"rewards": {
"function": "gm4_blossoming_pots:decorated/as_player"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dispatch for operations concerning the decorated pots plants
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# run from decorated/as_player

# summon the required amount of block displays, without data
execute \
unless entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.2] \
run function gm4_blossoming_pots:decorated/summon/initialize with block ~ ~ ~ item

# if new block displays summoned, catch it up to count
execute if score @s gm4_blossoming_pots.summon_loop matches 0 \
run function gm4_blossoming_pots:decorated/catch_up/initialize

# merge the data of the corresponding item amount variant with the block displays there
execute \
if entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.2] \
run function gm4_blossoming_pots:decorated/merge/initialize with block ~ ~ ~ item

# if merge score 0, succesfully merged data, play sound?
# merge or summon?
# merge score 0 triggers every pot interact, not ideal
# summon score 0 triggers only on first summon, not ideal either, but better
# ideally, we would only play sound on successful CHANGE, and not on just right click
execute if score @s gm4_blossoming_pots.summon_loop matches 0 run function gm4_blossoming_pots:decorated/sound/find with block ~ ~ ~ item

# kill marker
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sets up raycast, then redirects to as_marker, then revokes advancement
# @s = player who interacted with a decorated pot
# at @s
# run from advancement gm4_blossoming_pots:item_in_pot

# Raycast for the pot (set up range and search)
# range is 6 blocks, don't know how to handle custom block interaction range...
scoreboard players set @s gm4_blossoming_pots.range 1200
execute anchored eyes run function gm4_blossoming_pots:decorated/raycast/loop

execute as @e[type=minecraft:marker,sort=nearest,tag=gm4_blossoming_pots.temp.decorated_pot] at @s align xyz positioned ~.5 ~.5 ~.5 run function gm4_blossoming_pots:decorated/as_marker

# Reset advancement
advancement revoke @s only gm4_blossoming_pots:item_in_pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Intializes the loop for catching block display data up to current pot item count
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# run from decorated/as_marker

scoreboard players set @s gm4_blossoming_pots.catch_up_loop 0
function gm4_blossoming_pots:decorated/catch_up/loop with block ~ ~ ~ item
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# main loop for catching block display data up to current pot item count
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with block ~ ~ ~ item
# run from decorated/catch_up/initialize

scoreboard players add @s gm4_blossoming_pots.catch_up_loop 1

data modify storage gm4_blossoming_pots:decorated_pots temp.id set from block ~ ~ ~ item.id
execute store result storage gm4_blossoming_pots:decorated_pots temp.count int 1 run scoreboard players get @s gm4_blossoming_pots.catch_up_loop
$execute store result score @s gm4_blossoming_pots.merge_loop run data get storage gm4_blossoming_pots:decorated_pots $(id).display_count
function gm4_blossoming_pots:decorated/merge/loop

$execute unless score @s gm4_blossoming_pots.catch_up_loop matches $(count).. run function gm4_blossoming_pots:decorated/catch_up/loop with block ~ ~ ~ item
data remove storage gm4_blossoming_pots:decorated_pots temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# merges data of one block display with data from storage
# @s = a single block display
# at the center of the decorated pot, origin of the block display
# with storage gm4_blossoming_pots:decorated_pots temp
# run from decorated/merge/transfer

$data merge entity @s $(merge)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Intializes the loop for merging block display data
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with block ~ ~ ~ item
# run from decorated/as_marker


# we'll need a loop function to iterate over the index in storage and the cooresponding tags of block displays within range of marker
# n -> 0 stop when 0
$execute unless data storage gm4_blossoming_pots:decorated_pots $(id) run return 1
# store pot data in temp
$data modify storage gm4_blossoming_pots:decorated_pots temp set value {id:"$(id)",count:$(count)}

# set score of marker to the display count of the item in the pot, (number of block displays to modify)
$execute store result score @s gm4_blossoming_pots.merge_loop run data get storage gm4_blossoming_pots:decorated_pots $(id).display_count

# now, the rotation is stored, the pot data is stored, the scoreboard is set up
function gm4_blossoming_pots:decorated/merge/loop

# clear temp
data remove storage gm4_blossoming_pots:decorated_pots temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# main loop for merging block display data
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# run from decorated/merge/initialize
# run from this function...
# run from decorated/catch_up/loop

scoreboard players remove @s gm4_blossoming_pots.merge_loop 1

# store the current score into storage
execute store result storage gm4_blossoming_pots:decorated_pots temp.number int 1 run scoreboard players get @s gm4_blossoming_pots.merge_loop

# merge block display data
function gm4_blossoming_pots:decorated/merge/transfer with storage gm4_blossoming_pots:decorated_pots temp

# if there are more block displays to merge data, run again
execute unless score @s gm4_blossoming_pots.merge_loop matches 0 run function gm4_blossoming_pots:decorated/merge/loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# transfer layer of a function using macros :(
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with storage gm4_blossoming_pots:decorated_pots temp
# run from decorated/merge/loop



# we need to
# target select the right block display
# use temp.number for numbered tag
# limit=1,sort=nearest,distance=..0.2
# data modify entity @s <PATH???> merge from storage gm4_blossoming_pots:decorated_pots $(temp.pot.id).$(temp.pot.count)[$(temp.number)]
# AAAAAA
# i have to go another function deeper

# bail out if there isnt anything to merge here
$execute unless data storage gm4_blossoming_pots:decorated_pots $(id).$(count) run return 1

$data modify storage gm4_blossoming_pots:decorated_pots temp.merge set from storage gm4_blossoming_pots:decorated_pots $(id).$(count)[$(number)]
$execute as @n[tag=gm4_blossoming_pots.display.decorated_pot.$(number),distance=..0.2] run function gm4_blossoming_pots:decorated/merge/display with storage gm4_blossoming_pots:decorated_pots temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# checks if execution context is inside the decorated pots hit box
# @s = player who interacted with a decorated pot
# at @s anchored eyes, then marched forward 0.005 over and over. Complicated.
# run from decorated/raycast/loop

# early return if not dec pot
execute unless block ~ ~ ~ minecraft:decorated_pot run return fail

# summon marker for checking
summon minecraft:marker ~ ~ ~ {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 as @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.1] \
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 @e[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.1,sort=nearest]
return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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
# run from this function...


# 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 function gm4_blossoming_pots:decorated/raycast/in_pot run return run function gm4_blossoming_pots:decorated/raycast/player_rotation

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/loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# sets rotation data of the new temp marker from players
# @s = player who interacted with a decorated pot
# at @s anchored eyes, then marched forward 0.005 over and over. This should be in the same spot as the new temp marker
# run from decorated/raycast/loop

# player facing west
execute if entity @s[y_rotation=45..135] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:0}}
# player facing north
execute if entity @s[y_rotation=135..225] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:90}}
# player facing east
execute if entity @s[y_rotation=225..315] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:180}}
# player facing south
execute if entity @s[y_rotation=315..405] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:-90}}
Loading