Skip to content

Modernize (and Boltify) Liquid Tanks #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
dbaf45f
parent 2b4c9bd0a0dc3deb888ed7f37882006501c0f86b
SpecialBuilder32 Nov 15, 2022
d9d1806
Replace machine block Armor Stands with Display Entities
SpecialBuilder32 Mar 6, 2024
8b0aa09
Item display offsets
SpecialBuilder32 Mar 6, 2024
8f8318d
Adjust liquid display teleports
SpecialBuilder32 Mar 7, 2024
db01379
Check in API outline plans and first steps
SpecialBuilder32 Mar 25, 2024
c090154
liquid init API plans
SpecialBuilder32 Mar 25, 2024
267fe83
Potential post-definition method setup?
SpecialBuilder32 Mar 25, 2024
695b283
item_fill decorator setup
SpecialBuilder32 Mar 25, 2024
e1453de
Blind attempt at auto-gen item drain
SpecialBuilder32 Mar 25, 2024
71fdc50
Start of bolt integration
SpecialBuilder32 Mar 25, 2024
b7c1bac
Merge remote-tracking branch 'origin/master' into liquid-tanks-1.20
SpecialBuilder32 Jul 1, 2024
626541f
Override bolt formatting back to dense
SpecialBuilder32 Jul 7, 2024
aad53b6
Framework for componentized items
SpecialBuilder32 Jul 7, 2024
427a145
Retire storage api for new `if items` design
SpecialBuilder32 Jul 8, 2024
79e830e
Incorporate max allowable input stack size
SpecialBuilder32 Mar 26, 2024
c1076a2
Reusable standard units
SpecialBuilder32 Mar 26, 2024
aa353bf
Corrected standard-unit paths
SpecialBuilder32 Jul 10, 2024
3090742
Test new `if items` design api
SpecialBuilder32 Jul 11, 2024
eeb7468
Update bolt wrappers to `if items` api
SpecialBuilder32 Jul 11, 2024
8c30c4b
Restore decorator-based command insertion for item definitions
SpecialBuilder32 Jul 12, 2024
2f9c97a
Custom function naming providers - Makes potions cleaner
SpecialBuilder32 Jul 16, 2024
ffa252f
Test progress in game
SpecialBuilder32 Jul 17, 2024
81ba8c8
Update bolt liquid_init to use new item_displays
SpecialBuilder32 Jul 19, 2024
9f43cfb
Transfer standard_liquid item interactions to bolt
SpecialBuilder32 Jul 19, 2024
ec6895c
Cleanup item_drain naming logic
SpecialBuilder32 Jul 19, 2024
71a9cac
Switch to item_displays for visible liquid
SpecialBuilder32 Jul 22, 2024
d7858e0
Switch to new "item_name" name format for ink bottles
SpecialBuilder32 Jul 22, 2024
c715bf4
Support yield for mcfunction decoration
SpecialBuilder32 Jul 23, 2024
54002d5
Unused yield syntax support for item_drain
SpecialBuilder32 Jul 23, 2024
acf65c6
Cleanup development notes
SpecialBuilder32 Jul 23, 2024
24e166b
Trial fix for build action
SpecialBuilder32 Jul 25, 2024
a75e5c4
Apply bolt approach to standard_liquids for real
SpecialBuilder32 Jul 25, 2024
cb82e22
Merge remote-tracking branch 'upstream/master' into liquid-tanks-1.20
SpecialBuilder32 Jul 25, 2024
1882f5e
Increase experience-tank capacity to 50 levels
SpecialBuilder32 Jul 26, 2024
f431b9c
Math-based full level deposits when sneaking
SpecialBuilder32 Aug 4, 2024
51bcf49
Accelerating level deposit
SpecialBuilder32 Aug 4, 2024
14c4344
Accelerating math-based level withdraw when sneaking
SpecialBuilder32 Aug 4, 2024
616a728
Honey block cauldron casting uses display entities
SpecialBuilder32 Aug 4, 2024
7aba842
Fancier en-masse xp withdraw effects
SpecialBuilder32 Aug 6, 2024
95bc21c
Move mending tanks smart-logic bypass to new if-items api
SpecialBuilder32 Aug 6, 2024
d2dec67
Begin support for util_below wrappers
SpecialBuilder32 Aug 8, 2024
13fce81
Start of potion_liquids bolt migration
SpecialBuilder32 Aug 8, 2024
6c092ae
Vanilla potion effect & color data
SpecialBuilder32 Aug 11, 2024
fd9d460
Load in potion definitions to main.bolt
SpecialBuilder32 Aug 11, 2024
01d9639
Merge branch 'master' into liquid-tanks-1.20
SpecialBuilder32 Aug 15, 2024
f2ca573
Correct beet function attribute to real 1.21 syntax
SpecialBuilder32 Aug 15, 2024
2f31b8a
[incomplete] start to generated potion-liquids content
SpecialBuilder32 Aug 15, 2024
82323ac
Fix conflicting glass_bottle standard unit function names
SpecialBuilder32 Aug 15, 2024
4b401c7
Slight refactor to mcfunction generator storage for dynamic class cre…
SpecialBuilder32 Aug 16, 2024
1a7b12a
Merge branch 'master' into liquid-tanks-1.20
SpecialBuilder32 Aug 19, 2024
8716ed8
Skin assignment for strong potions uses base potions
SpecialBuilder32 Aug 19, 2024
cdfc2fe
[broken] progress toward fixed bolt util below
SpecialBuilder32 Aug 22, 2024
ff669bf
[failed] attempt at defer post-gen
SpecialBuilder32 Aug 22, 2024
a4f0e8d
[working] using defer to selectively emit cleanup commands
SpecialBuilder32 Aug 28, 2024
8c4c626
Use defer for util_below setup also
SpecialBuilder32 Aug 28, 2024
3b4fe92
Properly bind csv row data to util_below generation
SpecialBuilder32 Aug 28, 2024
e69fd2d
Long potions cannot be filled back into a bottle
SpecialBuilder32 Aug 30, 2024
931896b
Add multiple-effect potions (turtle master)
SpecialBuilder32 Aug 30, 2024
6022247
Potion tank naming
SpecialBuilder32 Aug 30, 2024
575d2e2
Boltify concrete mixers and update to new api
SpecialBuilder32 Sep 4, 2024
80cfdeb
LIAB to new bolt bindings
SpecialBuilder32 Sep 5, 2024
c7b2e29
Washing tanks to new LT api
SpecialBuilder32 Sep 5, 2024
aa63288
Update LT version number
SpecialBuilder32 Sep 5, 2024
7e2604c
Potion liquids creates missing skins based upon potion effect colors
SpecialBuilder32 Sep 6, 2024
e0e3f05
Automated mineskin creation of new potion skins (weaving, oozing ect)
SpecialBuilder32 Sep 6, 2024
175240f
Add tanks for thick, mundane and awkward potion types
SpecialBuilder32 Sep 6, 2024
0779092
Add Floating potion
SpecialBuilder32 Sep 6, 2024
924deb5
Cleanup old potion liquids files
SpecialBuilder32 Sep 6, 2024
6ece8bd
Modernize witch potion randomization method
SpecialBuilder32 Sep 6, 2024
70ec696
Kyrius's new liquid skin textures
SpecialBuilder32 Sep 6, 2024
7181138
Translations for new potion tank types
SpecialBuilder32 Sep 6, 2024
cb181e3
Fix '0' duration instant potions
SpecialBuilder32 Sep 6, 2024
df5967e
Translation tag for lightning tanks
SpecialBuilder32 Sep 6, 2024
1179237
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
SpecialBuilder32 Sep 6, 2024
c540b39
Cleanup and bug fixes
SpecialBuilder32 Sep 8, 2024
5ac40c6
Create bolt-docs.md
SpecialBuilder32 Sep 24, 2024
213aa30
Add ominous bottles to standard liquids
SpecialBuilder32 Sep 30, 2024
6eabf6a
complete ominous bottle tanks
SpecialBuilder32 Oct 8, 2024
0c5423f
Add honey casting packtest
SpecialBuilder32 Oct 24, 2024
92ff9d6
Use function tag for mud
SpecialBuilder32 Oct 24, 2024
c8a6adc
Resolve some PR comments
SpecialBuilder32 Oct 24, 2024
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
389 changes: 233 additions & 156 deletions gm4/skin_cache.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion gm4_cement_mixers/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ version: 1.4.X
data_pack:
load: .

require:
- bolt

pipeline:
- gm4.plugins.extend.module

meta:
gm4:
versioning:
required:
gm4_liquid_tanks: 2.3.0
gm4_liquid_tanks: 2.7.0
website:
description: Allows Liquid Tanks to convert Concrete Powder items into Concrete, at the cost of ⅓ of a Bucket of Water per Concrete Powder.
recommended: []
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# run from item_fill
# @s = liquid tank at @s

execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:black_concrete_powder"}} run function gm4_cement_mixers:item_fill/black_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:blue_concrete_powder"}} run function gm4_cement_mixers:item_fill/blue_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:brown_concrete_powder"}} run function gm4_cement_mixers:item_fill/brown_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:cyan_concrete_powder"}} run function gm4_cement_mixers:item_fill/cyan_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:gray_concrete_powder"}} run function gm4_cement_mixers:item_fill/gray_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:green_concrete_powder"}} run function gm4_cement_mixers:item_fill/green_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:light_blue_concrete_powder"}} run function gm4_cement_mixers:item_fill/light_blue_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:light_gray_concrete_powder"}} run function gm4_cement_mixers:item_fill/light_gray_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:lime_concrete_powder"}} run function gm4_cement_mixers:item_fill/lime_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:magenta_concrete_powder"}} run function gm4_cement_mixers:item_fill/magenta_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:orange_concrete_powder"}} run function gm4_cement_mixers:item_fill/orange_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:pink_concrete_powder"}} run function gm4_cement_mixers:item_fill/pink_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:purple_concrete_powder"}} run function gm4_cement_mixers:item_fill/purple_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:red_concrete_powder"}} run function gm4_cement_mixers:item_fill/red_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:white_concrete_powder"}} run function gm4_cement_mixers:item_fill/white_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:yellow_concrete_powder"}} run function gm4_cement_mixers:item_fill/yellow_concrete
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:dirt"}} run function gm4_cement_mixers:item_fill/mud
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:coarse_dirt"}} run function gm4_cement_mixers:item_fill/mud
execute if data storage gm4_liquid_tanks:temp/tank {input_slot:{id:"minecraft:rooted_dirt"}} run function gm4_cement_mixers:item_fill/mud
concretes_colors = (
"black",
"blue",
"brown",
"cyan",
"gray",
"green",
"light_blue",
"light_gray",
"lime",
"magenta",
"orange",
"pink",
"purple",
"red",
"white",
"yellow"
)
for color in concretes_colors:
execute if items block ~ ~ ~ container.0 f"minecraft:{color}_concrete_powder" run function f"gm4_cement_mixers:item_fill/{color}_concrete":
scoreboard players set $item_value gm4_lt_value -1
item replace entity 00344d47-0004-0004-0004-000f04ce104d weapon.mainhand with f"minecraft:{color}_concrete"
function gm4_liquid_tanks:smart_item_fill
tag @s add gm4_lt_fill

for variant in ("", "coarse_", "rooted_"):
execute if items block ~ ~ ~ container.0 f"minecraft:{variant}dirt" run function gm4_cement_mixers:item_fill/mud:
scoreboard players set $item_value gm4_lt_value -1
item replace entity 00344d47-0004-0004-0004-000f04ce104d weapon.mainhand with minecraft:mud
function gm4_liquid_tanks:smart_item_fill
tag @s add gm4_lt_fill
2 changes: 1 addition & 1 deletion gm4_lightning_in_a_bottle/assets/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ advancement.gm4.lightning_in_a_bottle.lightning_drink.description,Drink a Bottle
advancement.gm4.lightning_in_a_bottle.lightning_drink.title,Shocking!
advancement.gm4.lightning_in_a_bottle.lightning_shulker.description,Strike a Purpur Block with lightning to create a Shulker
advancement.gm4.lightning_in_a_bottle.lightning_shulker.title,It's Alive!
container.gm4.liquid_tank.lightning,Lightning Tank
container.gm4.liquid_tank.liab_lightning,Lightning Tank
effect.gm4.lightning_in_a_bottle.lightning,Lightning
item.gm4.bottle.effect.lightning,Bottle of Lightning
item.gm4.lingering_bottle.effect.lightning,Lingering Bottle of Lightning
Expand Down
7 changes: 7 additions & 0 deletions gm4_lightning_in_a_bottle/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ data_pack:
resource_pack:
load: .

require:
- bolt

pipeline:
- gm4_liquid_tanks.bolt_liquid_wrappers
- gm4.plugins.extend.module
- gm4.plugins.include.lib_brewing
- gm4.plugins.include.lib_potion_tracking

meta:
bolt:
entrypoint:
gm4_lightning_in_a_bottle:liquid_tanks/liquid_features
gm4:
versioning:
required:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting, I'm considering doing something similar with my interface for like kit pvp server kits.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from gm4_liquid_tanks:liquid_wrappers import liquid

@liquid
class BottledLightning:
id = 'liab_lightning'
name = "Lightning"
capacity = 300
skin = 'lightning_liquid'

liquid.init()

@liquid.item_fill("glass_bottle", "potion[custom_data~{gm4_lightning_in_a_bottle:1b}]", 1)
def fill_bottle():
loot replace entity 344d47-4-4-4-f04ce104d weapon.mainhand loot gm4_lightning_in_a_bottle:items/bottle_of_lightning

@liquid.util_below
def lightning_strike():
execute unless entity @s[predicate=gm4_lightning_in_a_bottle:on_fire] run function gm4_lightning_in_a_bottle:liquid_tanks/util/lightning:
execute at @s run summon lightning_bolt ~ ~ ~
scoreboard players remove @e[type=armor_stand,tag=gm4_liquid_tank,tag=gm4_processing_tank,distance=..8] gm4_lt_value 1
playsound entity.firework_rocket.twinkle block @a[distance=..8] ~ ~ ~ 2 1.5
advancement grant @s only gm4:lightning_in_a_bottle_drink
9 changes: 8 additions & 1 deletion gm4_liquid_tanks/beet.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
id: gm4_liquid_tanks
name: Liquid Tanks
version: 2.6.X
version: 2.7.X

data_pack:
load: .

resource_pack:
load: .

require:
- bolt

pipeline:
- override_formatting
- gm4.plugins.extend.module
- gm4.plugins.include.lib_machines
- gm4.plugins.include.lib_custom_crafters

meta:
bolt:
entrypoint:
- gm4_standard_liquids:main
gm4:
versioning:
required:
Expand Down
9 changes: 9 additions & 0 deletions gm4_liquid_tanks/bolt_liquid_wrappers.py
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really odd way to load the module. Was there a specific reason you are mounting this file in code? you could just do it directly in your beet.yaml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted a cleaner way to mount the bolt module from another subproject. Running a plugin from another module is pretty easy, but mounting this external bolt file in data_pack got ugly due to the long paths and scope jumps. It would've been something like data/gm4_liquid_tanks/modules/liquid_wrappers.bolt : ../gm4_liquid_tanks/data/gm4_liquid_tanks/modules/liquid_wrappers.bolt (if relative paths even work here, which I think they don't)

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# beet plugin to add the liquid_wrappers.bolt module to other gm4 datapacks more easily
from beet import Context
from bolt import Module
from pathlib import Path


def beet_default(ctx: Context):
print(Path.cwd())
ctx.data[Module]['gm4_liquid_tanks:liquid_wrappers'] = Module(source_path=Path("gm4_liquid_tanks/data/gm4_liquid_tanks/modules/liquid_wrappers.bolt"))
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@
# @s = processing tank

# merge count from input and set to tank
data modify storage gm4_liquid_tanks:temp/tank output.count set from storage gm4_liquid_tanks:temp/tank input_slot.count
data modify block ~ ~ ~ Items[{Slot:0b}] set from storage gm4_liquid_tanks:temp/tank output
item_modifier gm4_liquid_tanks:apply_output_count:
function: "minecraft:set_count"
count:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get wanting to use bolt, but what is the advantage of defining the item modifier here inline using the bolt syntax? I would move it out to a separate json file, or if you really want it here, use the vanilla inline item modifier syntax.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not really any advantage. It's a part of experimenting with the bolt syntax to see what feels most useful for gm4. Since this is the only place this modifier is used, it makes sense to define it here instead of in another file for clarity, and that's what this syntax does in build time.

Is there any theoretical downsides to vanilla inlining? Like in repeated parsings for example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance wise, vanilla inlining should perform just as well as a reference. During load they're converted to equivalent data structures.

type: "minecraft:score"
target:
type: "minecraft:fixed"
name: "$stack_size"
score: "gm4_lt_value"

item replace block ~ ~ ~ container.0 from entity 344d47-4-4-4-f04ce104d weapon.mainhand gm4_liquid_tanks:apply_output_count
item replace entity 344d47-4-4-4-f04ce104d weapon.mainhand with air

# apply value delta
scoreboard players operation @s gm4_lt_value += $stack_value gm4_lt_value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#run from liquid_tanks:liquid_value_update

scoreboard players set @s gm4_lt_value 0
execute positioned ~ ~-0.5 ~ run kill @e[type=armor_stand,tag=gm4_liquid_tank_display,distance=..0.5]
execute positioned ~ ~ ~ run kill @e[type=item_display,tag=gm4_liquid_tank_liquid_display,distance=..0.5]
data merge block ~ ~ ~ {CustomName:'{"translate":"gm4.second","fallback":"%1$s","with":[{"translate":"container.gm4.liquid_tank.empty","fallback":"Empty Tank"},[{"translate":"gui.gm4.liquid_tank","fallback":"","font":"gm4:container_gui","color":"white"},{"translate":"container.gm4.liquid_tank.empty","fallback":"Empty Tank","font":"gm4:default","color":"#404040"}]]}'}
data modify entity @s data.gm4_liquid_tanks.liquid_tag set value "empty"
function #gm4_liquid_tanks:remove_liquid_tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scoreboard objectives add gm4_lt_max dummy
scoreboard objectives add gm4_lt_prior_val dummy
scoreboard objectives add gm4_lt_disp_val dummy
scoreboard objectives add gm4_lt_util dummy
#declare storage gm4_liquid_tanks:temp/tank
#declare storage gm4_liquid_tanks:temp

execute unless score liquid_tanks gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Liquid Tanks"}
execute unless score liquid_tanks gm4_earliest_version < liquid_tanks gm4_modules run scoreboard players operation liquid_tanks gm4_earliest_version = liquid_tanks gm4_modules
Expand Down
Loading
Loading