[Bug]: Incompatability with mods affecting eye height
ryze312 opened this issue ยท 3 comments
Forge Version
14.23.5.2860
Galacticraft Version
4.0.6
Log or Crash Report
No response
Reproduction steps
- Load up any mod that affects eye height (e.g. FillyCam) with GalactiCraft
- Eye height modifications are broken
Note that FillyCam is for 1.11 and is mentioned merely as an example. I am currently in progress of porting it on Forge, so I stumbled upon this issue.
It seems that Galacticraft just extends Minecraft's EntityPlayer
and replaces it completely. This breaks a ton of things.
In this particular case the super method getEyeHeight
of base class is never called, so modifications of the original class (via Mixins or otherwise) don't have any effect.
Furthermore there seems to be a lot of duplicated code copied straight from the EntityPlayer
class. I really doubt this is the proper way.
As far as I can tell Galacticraft doesn't use Mixin, but the way you would do this via Mixins is by redirecting get field instruction to a method call.
This is how it would be done using Mixin:
@Mixin(EntityPlayer.class)
public abstract class MixinEntityPlayer {
@Redirect(method = "getEyeHeight()F", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/entity/player/EntityPlayer;eyeHeight:F"))
private float redirectEyeHeight(EntityPlayer player) {
// Calculate and return custom eye height
}
}
Almost none of the code in those packages have been changed since Micdoodle8 worked on the project.
But the mod will soon be put into maintenance mode, so I can fully focus on GC5 development on Forge. With that said it will no longer receive new features or compatibility updates. And I will not be introducing Mixins into the mod.