Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
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
41 changes: 41 additions & 0 deletions gm4_blossoming_pots/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: gm4_blossoming_pots
name: Blossoming Pots
version: 3.0.X
# should I start the version number over for gm4 release?
data_pack:
load: .
overlays:
- formats:
min_inclusive: 0
max_inclusive: 48
directory: overlay_48

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,23 @@
# Sets up loop for plant stage changes
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with block ~ ~ ~ item
# run from decorated/as_player

# early returns
$execute unless data storage gm4_blossoming_pots:decorated_pots $(id).$(count) run return run kill @s
$execute if data entity @n[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot] {FallDistance:$(count).0f} 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)

data modify storage gm4_blossoming_pots:decorated_pots temp.rotation set from entity @s data.rotation
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/loop with storage gm4_blossoming_pots:decorated_pots temp

$execute if score @s gm4_blossoming_pots.sound matches 1 as @a[distance=..16] \
run function gm4_blossoming_pots:decorated/play_sound with storage gm4_blossoming_pots:decorated_pots $(id)

kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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)
execute store result score @s gm4_blossoming_pots.range run attribute @s minecraft:block_interaction_range get 1
scoreboard players operation @s gm4_blossoming_pots.range *= $raycast_multiplier gm4_blossoming_pots.range
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 with block ~ ~ ~ item

# 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,27 @@
# Main Loop
# @s = temp marker inside decorated pot
# at @s align xyz positioned ~.5 ~.5 ~.5
# with storage gm4_blossoming_pots:decorated_pots temp
# which should contain {rotation, score, id, count, data}
# run from decorated/as_marker
# run from this function...

# summon if needed
$execute unless entity @n[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score)] \
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 @n[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score)] $(data)
# 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

# set FallDistance to the current stage of the display, this is used to prevent running the loop when the displays already have the desired data
$data merge entity @n[type=minecraft:block_display,distance=..0.1,tag=gm4_blossoming_pots.display.decorated_pot.$(score)] {FallDistance:$(count).0f}

# 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
# again if needed
execute unless score @s gm4_blossoming_pots.loop >= $array_len gm4_blossoming_pots.loop run function gm4_blossoming_pots:decorated/loop with storage gm4_blossoming_pots:decorated_pots temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# literally just plays sound
# @s = a single player within 16 blocks of the decorated pot
# with storage gm4_blossoming_pots:decorated_pots <id of item in decorated pot>
# at the center of the decorated pot
# run from decorated/as_marker

$playsound $(place_sound) block @s ~ ~ ~
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