Skip to content

Fix for Cow -> AbstractCow bytecode remap#2727

Merged
mcmonkey4eva merged 3 commits intoDenizenScript:devfrom
tal5:Cow_Variant_Fixes
May 22, 2025
Merged

Fix for Cow -> AbstractCow bytecode remap#2727
mcmonkey4eva merged 3 commits intoDenizenScript:devfrom
tal5:Cow_Variant_Fixes

Conversation

@tal5
Copy link
Copy Markdown
Member

@tal5 tal5 commented May 22, 2025

Fixes https://discord.com/channels/315163488085475337/1359093430533226586/1374101228211929263.

Needs DenizenScript/Denizen-Core#112

Cow acted as AbstractCow on old versions (I.e. other cow variants extended it), so plugins with an older API version get Cow remapped to the new AbstractCow for stuff like instanceof checks and whatnot to work as they used to - since we can't bump the API version obviously, this works around it with reflection.

@mcmonkey4eva mcmonkey4eva merged commit 3138bcf into DenizenScript:dev May 22, 2025
1 check passed
@tal5 tal5 deleted the Cow_Variant_Fixes branch May 27, 2025 21:47
fullwall pushed a commit to CitizensDev/Citizens2 that referenced this pull request Jun 7, 2025
…map (#3249)

* fix: set cow variant by using MethodHandle because of bad bytecode remap

Thanks to @MC-Samuel for referencing to the way of fixing it.

Reference:
https://discord.com/channels/315163488085475337/1380252795701301308/1380767310658146454
DenizenScript/Denizen#2727

* chore: remove unused import
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