Closed ryze312 closed 11 months ago
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.
https://github.com/TeamGalacticraft/Galacticraft-Legacy/blob/ff4ebbee20bc2bbd16a3cbf002d20ed69f4689e8/src/main/java/micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP.java#L446-L455
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.
Forge Version
14.23.5.2860
Galacticraft Version
4.0.6
Log or Crash Report
No response
Reproduction steps
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.