Fixes the inventory items not moving properly.

This commit is contained in:
Markil3
2021-06-18 08:46:06 -06:00
parent 3b73bf6cb8
commit 4d1cf0d9e2
10 changed files with 13 additions and 5 deletions

0
demo.gif Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 37 MiB

After

Width:  |  Height:  |  Size: 37 MiB

0
screenshot1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

0
screenshot2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 767 KiB

After

Width:  |  Height:  |  Size: 767 KiB

0
screenshot3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

0
screenshot4.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 983 KiB

After

Width:  |  Height:  |  Size: 983 KiB

0
screenshot5.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 405 KiB

After

Width:  |  Height:  |  Size: 405 KiB

View File

@@ -54,7 +54,7 @@ import java.util.Optional;
* Contains the logic for changing the HUD.
*
* @author Markil 3
* @version 0.1-1.16.4-fabric
* @version 1.1.1-1.17-fabric
*/
public class TimerUtils
{
@@ -1150,8 +1150,6 @@ public class TimerUtils
* Determines whether or not to draw the crosshair, adjusting the alpha as
* needed.
*
* @return If true, then cancel drawing the crosshair.
*
* @since 0.1-1.16.4-fabric
*/
public static void recolorHotbar(MatrixStack stack)
@@ -1165,5 +1163,12 @@ public class TimerUtils
hotbar.getMaxTime(),
hotbar.getFadeInTime(),
hotbar.getFadeOutTime()));
/*
* Update the hotbar item matrix
*/
stack = RenderSystem.getModelViewStack();
stack.push();
stack.translate(0F, TimerUtils.getHotbarTranslation(), 0F);
RenderSystem.applyModelViewMatrix();
}
}

View File

@@ -40,7 +40,7 @@ import markil3.immersive_hud.TimerUtils;
* that most of the logic can be found in {@link TimerUtils}.
*
* @author Markil 3
* @version 0.1-1.16.4-fabric
* @version 1.1.1-1.17-fabric
*/
@Mixin(InGameHud.class)
public class HudHook
@@ -661,7 +661,7 @@ public class HudHook
* @param stack - The matrix drawing stack.
* @param callbackInfo
*
* @version 0.2-1.16.4-fabric
* @version 1.1.1-1.17-fabric
* @since 0.1-1.16.4-fabric
*/
@Inject(method = "renderHotbar", at = @At(value = "TAIL"))
@@ -672,6 +672,9 @@ public class HudHook
try
{
stack.pop();
stack = RenderSystem.getModelViewStack();
stack.pop();
RenderSystem.applyModelViewMatrix();
/*
* Resets the color so that nothing else is bothered.
*/

0
src/main/resources/assets/immersive_hud/icon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 380 KiB

After

Width:  |  Height:  |  Size: 380 KiB

View File