-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from UselessBullets/next-hudfade
Implemented Hud Fade
- Loading branch information
Showing
10 changed files
with
151 additions
and
6 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
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
12 changes: 12 additions & 0 deletions
12
src/main/java/useless/legacyui/Mixins/Gui/GuiIngameAccessor.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,12 @@ | ||
package useless.legacyui.Mixins.Gui; | ||
|
||
import net.minecraft.client.gui.GuiIngame; | ||
import net.minecraft.client.render.entity.ItemEntityRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
@Mixin(value = GuiIngame.class, remap = false) | ||
public interface GuiIngameAccessor { | ||
@Accessor | ||
ItemEntityRenderer getItemRenderer(); | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/useless/legacyui/Mixins/ItemEntityRendererMixin.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,22 @@ | ||
package useless.legacyui.Mixins; | ||
|
||
import net.minecraft.client.render.FontRenderer; | ||
import net.minecraft.client.render.RenderEngine; | ||
import net.minecraft.client.render.entity.ItemEntityRenderer; | ||
import org.lwjgl.opengl.GL11; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = ItemEntityRenderer.class, remap = false) | ||
public class ItemEntityRendererMixin { | ||
@Inject(method = "drawItemIntoGui(Lnet/minecraft/client/render/FontRenderer;Lnet/minecraft/client/render/RenderEngine;IIIIIFF)V", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glDisable(I)V", ordinal = 1)) | ||
private void enableAlphaOnItems(FontRenderer fontrenderer, RenderEngine renderengine, int i, int j, int k, int l, int i1, float brightness, float alpha, CallbackInfo ci){ | ||
GL11.glEnable(GL11.GL_BLEND); | ||
} | ||
@Inject(method = "drawItemIntoGui(Lnet/minecraft/client/render/FontRenderer;Lnet/minecraft/client/render/RenderEngine;IIIIIFF)V", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glEnable(I)V", ordinal = 1)) | ||
private void disableAlphaAfterItems(FontRenderer fontrenderer, RenderEngine renderengine, int i, int j, int k, int l, int i1, float brightness, float alpha, CallbackInfo ci){ | ||
GL11.glDisable(GL11.GL_BLEND); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/useless/legacyui/Mixins/RenderBlocksMixin.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,16 @@ | ||
package useless.legacyui.Mixins; | ||
|
||
import net.minecraft.client.render.RenderBlocks; | ||
import org.lwjgl.opengl.GL11; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import useless.legacyui.Gui.GuiScreens.UtilGui; | ||
|
||
@Mixin(value = RenderBlocks.class, remap = false) | ||
public class RenderBlocksMixin { | ||
@Redirect(method = "renderBlockOnInventory(Lnet/minecraft/core/block/Block;IF)V", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glColor4f(FFFF)V")) | ||
private void addAlphaSupport(float red, float green, float blue, float alpha){ | ||
GL11.glColor4f(red, green, blue, UtilGui.blockAlpha); | ||
} | ||
} |
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
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