Skip to content

Commit

Permalink
Inserting fluid containers into a titration barrel that can't accept …
Browse files Browse the repository at this point in the history
…the fluid from it now puts the container in as an item, + Mermaid Gem guidebook additions
  • Loading branch information
f-raZ0R committed Oct 22, 2024
1 parent 6cfc830 commit 11a7eeb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trinkets_version=3.7.1
step_height_attribute_version=1.2.0
cca_version=5.2.2
additional_entity_attributes_version=1.7.5+1.20.0
revelationary_version=1.3.8+1.20.1
revelationary_version=1.3.9+1.20.1
fractal_version=1.2.0
matchbooks_version=0.1.0
# https://github.com/JamiesWhiteShirt/reach-entity-attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
if (blockEntity instanceof TitrationBarrelBlockEntity barrelEntity) {

BarrelState barrelState = state.get(BARREL_STATE);
ItemStack handStack = player.getStackInHand(hand);
switch (barrelState) {
case EMPTY, FILLED -> {
if (player.isSneaking()) {
if (player.isSneaking() && handStack.isEmpty()) {
if (barrelState == BarrelState.FILLED) {
tryExtractLastStack(state, world, pos, player, barrelEntity);
}
} else {
// player is able to put items in
// or seal it with a piece of colored wood
ItemStack handStack = player.getStackInHand(hand);
if (handStack.isEmpty()) {
int itemCount = InventoryHelper.countItemsInInventory(barrelEntity);
Fluid fluid = barrelEntity.fluidStorage.variant.getFluid();
Expand Down Expand Up @@ -105,7 +105,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
return ActionResult.CONSUME;
}

if (ContainerItemContext.forPlayerInteraction(player, hand).find(FluidStorage.ITEM) != null) {
if (ContainerItemContext.forPlayerInteraction(player, hand).find(FluidStorage.ITEM) != null ) {
if (FluidStorageUtil.interactWithFluidStorage(barrelEntity.fluidStorage, player, hand)) {
if (barrelEntity.getFluidVariant().isBlank()) {
if (state.get(BARREL_STATE) == TitrationBarrelBlock.BarrelState.FILLED && barrelEntity.isEmpty()) {
Expand All @@ -116,8 +116,8 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
world.setBlockState(pos, state.with(BARREL_STATE, TitrationBarrelBlock.BarrelState.FILLED));
}
}
return ActionResult.CONSUME;
}
return ActionResult.CONSUME;
}

int countBefore = handStack.getCount();
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/assets/spectrum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3069,8 +3069,9 @@
"book.spectrum.guidebook.mermaids_brush.name": "Mermaid's Brushes",
"book.spectrum.guidebook.mermaids_brush.page0.text": "Mermaid's Brushes are an inconspicuous plant I found growing in the deepest depths of oceans, forever untouched by human influence.\\\n\\\nThey grow a single blossom, which slowly develops into a pearl-shaped seed. When fully grown, these hollow seeds float to the surface to be carried away by the waves.",
"book.spectrum.guidebook.mermaids_brush.page0.title": "Mermaid's Brushes",
"book.spectrum.guidebook.mermaids_brush.page1.text": "These seeds can be planted to grow another plant.\\\n\\\nMermaid's Gems have a strong bond with water - obviously.",
"book.spectrum.guidebook.mermaids_jam.page0.text": "A special kind of [Cheong](entry://cuisine/cheong) made from [Mermaid's Gems](entry://general/mermaids_brush).\\\n\\\nThe recipe didn't win me over mainly with its flavour, that's for sure (especially not without eating something with it).\nBut it does impress with the additional effect of water breathing.",
"book.spectrum.guidebook.mermaids_brush.page1.text": "These seeds can be planted to grow another plant.\\\n\\\nMermaid's Gems have a strong bond with water - So much so, that when I crack one open, water just comes rushing out.\\\n\\\n*Much more convenient than lugging heavy buckets filled to the brim with water around...*\\\n*Where does the water come from?*",
"book.spectrum.guidebook.mermaids_brush.page1.title": "Mermaid's Gems",
"book.spectrum.guidebook.mermaids_jam.page0.text": "A special kind of [Cheong](entry://cuisine/cheong) made from [Mermaid's Gems](entry://general/mermaids_brush).\\\n\\\nThe recipe didn't win me over mainly with its flavour, that's for sure (especially not without eating something with it).\\\nBut it does impress with the additional effect of water breathing.",
"book.spectrum.guidebook.mermaids_jam.page1.text": "*Tastes like the ocean*\\\n\\\nNot as sweet as the other ones, but still, very tasty. It has a light note of salt.",
"book.spectrum.guidebook.mermaids_popcorn.page0.text": "You know, these little seedlings of Mermaids Brushes are actually quite tasty. Of course I had to try them.\\\nGetting them out of their shells is always a pain, though (just like my shy friends!).\\\nThen I heated them up really strongly until the pressure from the inside caused the shell to burst all by itself.\\\n\\\n*Crunchy*",
"book.spectrum.guidebook.mermaids_popcorn.page1.text": "*I could eat a whole bag in one sitting while watching my mob farm work.*",
Expand Down

0 comments on commit 11a7eeb

Please sign in to comment.