-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
5 changed files
with
88 additions
and
16 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
42 changes: 42 additions & 0 deletions
42
...t/raphimc/immediatelyfast/fabric/injection/mixins/screen_batching/MixinHandledScreen.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,42 @@ | ||
/* | ||
* This file is part of ImmediatelyFast - https://github.com/RaphiMC/ImmediatelyFast | ||
* Copyright (C) 2023 RK_01/RaphiMC and contributors | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package net.raphimc.immediatelyfast.fabric.injection.mixins.screen_batching; | ||
|
||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.raphimc.immediatelyfast.feature.batching.BatchingBuffers; | ||
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.Redirect; | ||
|
||
@Mixin(value = HandledScreen.class, priority = 500) | ||
public abstract class MixinHandledScreen { | ||
|
||
@Shadow | ||
public static void drawSlotHighlight(MatrixStack matrices, int x, int y, int z) { | ||
} | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawSlotHighlight(Lnet/minecraft/client/util/math/MatrixStack;III)V")) | ||
private void drawSlotHightlightOnTop(MatrixStack matrices, int x, int y, int z) { | ||
BatchingBuffers.beginItemOverlayRendering(); | ||
drawSlotHighlight(matrices, x, y, z); | ||
BatchingBuffers.endItemOverlayRendering(); | ||
} | ||
|
||
} |
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
42 changes: 42 additions & 0 deletions
42
...et/raphimc/immediatelyfast/forge/injection/mixins/screen_batching/MixinHandledScreen.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,42 @@ | ||
/* | ||
* This file is part of ImmediatelyFast - https://github.com/RaphiMC/ImmediatelyFast | ||
* Copyright (C) 2023 RK_01/RaphiMC and contributors | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package net.raphimc.immediatelyfast.forge.injection.mixins.screen_batching; | ||
|
||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.raphimc.immediatelyfast.feature.batching.BatchingBuffers; | ||
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.Redirect; | ||
|
||
@Mixin(value = HandledScreen.class, priority = 500) | ||
public abstract class MixinHandledScreen { | ||
|
||
@Shadow | ||
public static void renderSlotHighlight(MatrixStack matrices, int x, int y, int z, int slotColor) { | ||
} | ||
|
||
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;renderSlotHighlight(Lnet/minecraft/client/util/math/MatrixStack;IIII)V")) | ||
private void drawSlotHightlightOnTop(MatrixStack matrices, int x, int y, int z, int slotColor) { | ||
BatchingBuffers.beginItemOverlayRendering(); | ||
renderSlotHighlight(matrices, x, y, z, slotColor); | ||
BatchingBuffers.endItemOverlayRendering(); | ||
} | ||
|
||
} |
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