juancarloscp52 / BedrockIfy

A Minecraft mod that implements some Minecraft Bedrock features into Java edition.
GNU General Public License v3.0
165 stars 35 forks source link

Add compatibility for 1.21 #352

Closed lonefelidae16 closed 2 weeks ago

lonefelidae16 commented 2 weeks ago

Hi, I brought 1.21 compatibility code.


Changes

SunGlare feature:

SavingOverlay feature:

EatingAnimations feature:

Thanks for all your work!

lonefelidae16 commented 2 weeks ago

I’ll move this pull to draft as I found a few things I wanna try regarding the Cauldron feature I mentioned in #350 .


From the logs:

server

LOGGER.info("item tags check: WOLF_ARMOR.isIn(ItemTags.DYEABLE) = {}", Items.WOLF_ARMOR.getDefaultStack().isIn(ItemTags.DYEABLE));
// got "item tags check: WOLF_ARMOR.isIn(ItemTags.DYEABLE) = true"

client

LOGGER.info("item tags check: WOLF_ARMOR.isIn(ItemTags.DYEABLE) = {}", Items.WOLF_ARMOR.getDefaultStack().isIn(ItemTags.DYEABLE));
// got "item tags check: WOLF_ARMOR.isIn(ItemTags.DYEABLE) = false"

These filter gets the empty result on the Client.

https://github.com/juancarloscp52/BedrockIfy/blob/c4bc4f425adffaab1a7bdf4c8740f12281e94668/src/main/java/me/juancarloscp52/bedrockify/common/block/cauldron/BedrockCauldronBehavior.java#L482-L484

And returns ActionResult.PASS in ClientPlayerInteractionManager#interactBlock due to the default return value ItemResult.PASS_TO_DEFAULT_BLOCK_INTERACTION defined in CauldronBehavior#createMap.

I avoided hardcoding in consideration of other Mods and data packs, but it seems difficult to get the ItemTags on the Client. I’m looking for a way to break the ice...

lonefelidae16 commented 2 weeks ago

I guess I was thinking too hard haha. Just replace registration point with ClientPlayConnectionEvents.JOIN will fix. Everything works.