forked from Jorbon/cool_elytra
-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
- Unembedded a dependency on my shared library. | ||
- This reduces disk space required when using more than one of my mods. | ||
- It also makes it easier for me to push fixes to that library without creating updates for every single mod that uses it. | ||
- Fixed an issue with hud rendering on Forge introduced in a recent update. (#127) |
38 changes: 38 additions & 0 deletions
38
forge/src/main/java/nl/enjarai/doabarrelroll/mixin/forge/InGameHudMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package nl.enjarai.doabarrelroll.mixin.forge; | ||
|
||
import com.llamalad7.mixinextras.sugar.Share; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef; | ||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.hud.InGameHud; | ||
import nl.enjarai.doabarrelroll.EventCallbacksClient; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(InGameHud.class) | ||
public abstract class InGameHudMixin { | ||
@Shadow | ||
protected int scaledWidth; | ||
@Shadow | ||
protected int scaledHeight; | ||
|
||
@Inject( | ||
method = "renderCrosshair", | ||
at = @At(value = "HEAD") | ||
) | ||
private void doABarrelRoll$renderCrosshairHead(DrawContext context, CallbackInfo ci) { | ||
context.getMatrices().push(); | ||
// There's really no way for me to get it, so no tickdelta for you Forge! | ||
EventCallbacksClient.onRenderCrosshair(context, 0, scaledWidth, scaledHeight); | ||
} | ||
|
||
@Inject( | ||
method = "renderCrosshair", | ||
at = @At(value = "RETURN") | ||
) | ||
private void doABarrelRoll$renderCrosshairReturn(DrawContext context, CallbackInfo ci) { | ||
context.getMatrices().pop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters