How-Bout-No / Outvoted

Outvoted is a Minecraft mod that adds in mobs from previous mob votes that weren't able to make it into the game, trying to stay true to the original concepts.
GNU General Public License v3.0
22 stars 10 forks source link

[MobZ @Redirect crash] Fabric 1.17.1 #106

Closed WolfBV closed 2 years ago

WolfBV commented 2 years ago

Describe the bug Crash with MobZ when launching an instance

To Reproduce Steps to reproduce the behavior:

  1. Download Outvoted-1.5.0-beta.4
  2. Download Geckolib 3.0.16 or higher
  3. Download MobZ-3.2.0-fabric.jar
  4. Launch

Screenshots/Logs https://pastebin.com/pES1hbLV

Version (please complete the following information):

How-Bout-No commented 2 years ago

I am actually unsure if I can do anything about this. From what I know, this specific mixin redirect is required for modded shields to work properly, so its not like I can remove it.

WolfBV commented 2 years ago

I'll ask rikka

How-Bout-No commented 2 years ago

I just took the simple approach and instead of redirecting just inject the mixin at the start and go from there. Will be fixed next beta.

How-Bout-No commented 2 years ago

Fixed in beta 5

rikka0w0 commented 2 years ago

How is this be fixed? I'm thinking if I can do something on my side to improve the compatibility.

I just remembered Fabric is missing a custom shield API.

How-Bout-No commented 2 years ago

How is this be fixed? I'm thinking if I can do something on my side to improve the compatibility.

I just remembered Fabric is missing a custom shield API.

I basically just made a copy of the entire original method but changed the initial item check, and injected that into the method rather than redirecting anything. Definitely not elegant but ensures compatibility. See here: https://github.com/How-Bout-No/Outvoted/blob/1.17.1/fabric/src/main/java/io/github/how_bout_no/outvoted/fabric/mixin/MixinPlayerEntity.java#L35

rikka0w0 commented 2 years ago

How is this be fixed? I'm thinking if I can do something on my side to improve the compatibility. I just remembered Fabric is missing a custom shield API.

I basically just made a copy of the entire original method but changed the initial item check, and injected that into the method rather than redirecting anything. Definitely not elegant but ensures compatibility. See here: https://github.com/How-Bout-No/Outvoted/blob/1.17.1/fabric/src/main/java/io/github/how_bout_no/outvoted/fabric/mixin/MixinPlayerEntity.java#L35

That's really helpful and I should do the same change to improve compatibility with other mods.

The best solution is to tell Fabric to add a shield API.

rikka0w0 commented 2 years ago

You may want to have a look at this: https://www.curseforge.com/minecraft/mc-mods/fabric-shield-lib/files/3544625

A shield API!