Skip to content

Implement GemKnife - #36

Draft
cpaca wants to merge 34 commits into
TraceLTRC:masterfrom
cpaca:LibraryOfMemories
Draft

Implement GemKnife#36
cpaca wants to merge 34 commits into
TraceLTRC:masterfrom
cpaca:LibraryOfMemories

Conversation

@cpaca

@cpaca cpaca commented Jul 6, 2024

Copy link
Copy Markdown
Contributor

Util.shulkerForEach(box, action) does these 3 steps at once:

  • Gets the shulker-box's inventory
  • inventory.forEach(action)
  • Saves the shulker-box's inventory.

Why?

Honestly? I wanted to have a shulker-box of momentos. However, I do vaguely remember something about wanting "holoitems with inventories" (gem knife, quartz blossom, corrupted wheat seeds, watering can, hourglass, rift walker) to not have their own inventory, and instead take stuff from the player's inventory.

Therefore, shulkerForEach is meant to make it easier for these items to also search shulkers inside the player's inventory. Notably, gem knife (with this) won't require you to take the emeralds out of shulkerboxes.

Did you say "shulker-box of momentos" earlier?

My test subject of choice was to make a holoitem that's the same as a shulkerbox, but when you die it'll trigger any momento abilities that are also inside of the shulker-box.

To be clear, I'd been theorycrafting this for a while, though today's ARH session is what pissed me off enough to implement this immediately even though it's a new holoitem. (Additionally, I'd forgotten Gem Knife exists, and Momento is already implemented so in theory it shouldn't be too much ontop of that.)

What are these changes in BlockAbility?

Well, to make a shulker box custom item, I couldn't figure out how to get it work as an enchantment. I swapped it to a custom item, but it kept deleting the contents, so I wrote some stuff in BlockAbility so it'd stop doing that.

Balance problems/too weak/strong/don't like it/will not add to main server/etc.

The main purpose of this commit was for Util.shulkerForEach. LibraryShulkerBox doesn't have a recipe, and I sprung this all on you without any warning. I don't mind that much if LibraryShulkerBox gets deleted, although I will be a little sad since it's useful for reducing the number of inventory slots I'm using.

That said, the changes I made to BlockAbility might be helpful for future shulker holoitems, so those might be worth a keep as well.

cpaca added 7 commits July 6, 2024 11:01
This isn't working (and shulkerStateMeta.setBlockState(box); isn't fixing it)
Turns out shulkerForEach was written right the first time, it's just that Library wasn't.
I am 100% confident this thing is now broken.
This primarily affects the lore.
@cpaca
cpaca marked this pull request as draft July 6, 2024 20:43
@cpaca

cpaca commented Jul 6, 2024

Copy link
Copy Markdown
Contributor Author

I just remembered - when I was testing this with other colors of shulkerbox, it wasn't working. Can either continue working on that, or scrap library of memories, or scrap the entire branch (and decide gem knife won't get to take emerald blocks from your inventory)

@dlee13

dlee13 commented Jul 6, 2024

Copy link
Copy Markdown
Collaborator

Everything you did to BlockAbility is wrong. You're supposed to do that in an Override on LibraryShulkerBox. Save the box contents, call the super method, then set the box contents.

@cpaca cpaca changed the title Add Util.shulkerForEach Implement GemKnife Jul 7, 2024
Comment thread src/main/java/xyz/holocons/mc/holoitemsrevamp/enchantment/Library.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants