Skip to content

Update to 1.21.5#300

Merged
Jikoo merged 14 commits intomasterfrom
dev/1_21_5
Apr 25, 2025
Merged

Update to 1.21.5#300
Jikoo merged 14 commits intomasterfrom
dev/1_21_5

Conversation

@Jikoo
Copy link
Copy Markdown
Owner

@Jikoo Jikoo commented Apr 19, 2025

As usual, I have not yet tested this, nor completed my entire update checklist.

  • Check player tag deserialization
  • Update resource pack versioning
  • Check if #snap is the correct method for moving to spawn in previous versions
  • Test
    • 1.21.5 (probably works)
    • Spigot 1.21.5
    • 1.21.4
    • 1.21.3 (if this works, 1.21.1 should be fine)
    • 1.21.2 (is this identical to .3 or .1? I think it may be .3, so this may be broken because it uses .1 adapter)

Closes #299

@Jikoo
Copy link
Copy Markdown
Owner Author

Jikoo commented Apr 20, 2025

Paper 1.21.5 is functional. Still a bit to go on 1.21.4 (I got greedy when reducing duplicate code :( Might be a workaround, but might be more trouble than it's worth) so that means that all of the lower versions are also nonfunctional.

Spigot 1.21.5 is not functional. It looks like one of the fields that makes working with the new armor contents a bit easier is a Paper construct. Unfortunately, the options for fixing it are a bunch more duplicate code (not to be confused with the automatically generated "duplicate" code from reobfuscation) or making changes to the currently functional Paper version and have to re-test. Paper also has loosened the access on some members I was eager to reuse, so I'll need to re-add some of the shadowed fields for that.

Jikoo added 2 commits April 20, 2025 21:24
Still not there, because Spigot doesn't expose Inventory.equipment, which is a huge problem for design.
@Jikoo
Copy link
Copy Markdown
Owner Author

Jikoo commented Apr 21, 2025

Paper 1.21.5 appears functional still. Spigot is... messy. Everything except /openinv works fine. The problem is that Spigot really does an unfortunately bad job (i.e. not really bothering at all) of exposing inventory slot conversions.
For example, here's Spigot's method for setting a helmet:

  @Override
  public void setHelmet(ItemStack helmet) {
    setItem(getSize() - 2, helmet);
  }

This is how OpenInv did it on 1.21.4:

@Override
public void setHelmet(@Nullable ItemStack helmet) {
getInventory().getOwnerHandle().getInventory().armor
.set(EquipmentSlot.HEAD.getIndex(), CraftItemStack.asNMSCopy(helmet));
}

Here's the same functionality using the new field Paper exposes:

  @Override
  public void setHelmet(@Nullable ItemStack helmet) {
    getInventory().getOwnerHandle().getInventory().equipment
        .set(EquipmentSlot.HEAD, CraftItemStack.asNMSCopy(helmet));
  }

My reward for avoiding using magic values where possible, apparently.

/e: I should mention that this particular area isn't the huge blocker - I'll probably just reroute it to the Bukkit version. The pain point is really that I'll have to figure out how to rework the slot implementations in the inventory layout.

1.21.4 support is almost there. For some reason opening your own inventory doesn't display your armor. I haven't taken a dive into what I messed up there, but it probably was simple. Either way, that's it for me for today.

I should probably just give up on building Spigot out of Paper and update it separately next time, the differences are adding up.
@Jikoo
Copy link
Copy Markdown
Owner Author

Jikoo commented Apr 23, 2025

Apologies, hitting another project crunch. Hopefully sanity will be restored by Friday.

@Jikoo Jikoo mentioned this pull request Apr 23, 2025
@ghost
Copy link
Copy Markdown

ghost commented Apr 24, 2025

My personal recommendation is to drop spigot support for newer versions, since in 1.21.5 spigot isn't really used. Depends what is easier I suppose. Would also be a good opportunity to publish openinv on modern platforms like modrinth, curseforge and hangar (and earn ad revenue I suppose...)
Openinv is a very good plugin but not many people know about it due to it only being on bukkit.org, and its unique selling point about being able to edit inventories of offline players isn't advertised much.
Also I can make you a logo for openinv modrinth/hangar page if you need one.

@Jikoo
Copy link
Copy Markdown
Owner Author

Jikoo commented Apr 24, 2025

1.21.5 Paper and Spigot are both functional now. The blocker for release is that I messed up something with 1.21.4 which is causing armor slots to not display when opening own inventory, which means lower versions are also messed up. Unfortunately I have a project due tonight and cannot really devote time into looking into it before that is completed. Work before hobbies and all that.

If you're on 1.21.5 already, you can just download the artifact from the most recent CI run of this branch and should be fine. If you're looking to migrate more slowly the way I usually try to support, unfortunately I'm not there yet.

Appreciate the offer, not sure at this point what I want to do about Modrinth and Hangar. I think I made a project on at least one of them ages ago and then never progressed due to the newness and lack of support by tools. I will have to swap the Action I use for publishing them, and while I have looked at mc-publish for that, I don't really have the mental bandwidth to deal with the idea in this moment. Publishing is my least favorite part of the update process, which is why it's fully automated (and also why OI doesn't have a Spigot page, can't automate that without a lot of hackery).

@ghost
Copy link
Copy Markdown

ghost commented Apr 24, 2025

can we get a 1.21.5 paper jar to test?

@Jikoo
Copy link
Copy Markdown
Owner Author

Jikoo commented Apr 24, 2025

Every action run produces a jar in the dist artifact.

Jikoo added 6 commits April 25, 2025 11:09
Almost like naming all of these classes the same exact thing was a bad idea or something
@Jikoo Jikoo enabled auto-merge (squash) April 25, 2025 15:39
@Jikoo Jikoo disabled auto-merge April 25, 2025 15:41
@Jikoo Jikoo enabled auto-merge (squash) April 25, 2025 15:44
@Jikoo Jikoo merged commit ad06b46 into master Apr 25, 2025
2 checks passed
@Jikoo Jikoo deleted the dev/1_21_5 branch April 25, 2025 15:47
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.

1.21.5 support

1 participant