-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
efd88ef
commit dbd3638
Showing
2 changed files
with
17 additions
and
17 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
28 changes: 14 additions & 14 deletions
28
src/main/java/com/xiao_xing/BetterTooltipBox/Mixins/drawSelectionBoxMixin.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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
package com.xiao_xing.BetterTooltipBox.Mixins; | ||
|
||
import net.minecraft.client.renderer.OpenGlHelper; | ||
import static com.xiao_xing.BetterTooltipBox.Config.Enable_SelectionBox; | ||
|
||
import net.minecraft.client.renderer.RenderGlobal; | ||
import net.minecraft.util.AxisAlignedBB; | ||
import net.minecraft.util.MovingObjectPosition; | ||
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 static com.xiao_xing.BetterTooltipBox.Config.Enable_SelectionBox; | ||
|
||
@Mixin(RenderGlobal.class) | ||
public class drawSelectionBoxMixin { | ||
|
||
@Redirect( | ||
method = "drawSelectionBox", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/renderer/RenderGlobal;drawOutlinedBoundingBox(Lnet/minecraft/util/AxisAlignedBB;I)V")) | ||
method = "drawSelectionBox", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/renderer/RenderGlobal;drawOutlinedBoundingBox(Lnet/minecraft/util/AxisAlignedBB;I)V")) | ||
public void drawOutlinedBoundingBox(AxisAlignedBB p_147590_0_, int p_147590_1_) { | ||
if(Enable_SelectionBox){ | ||
if (Enable_SelectionBox) { | ||
float time = (System.currentTimeMillis() % 5000L) / 5000.0f * (float) (2 * Math.PI); | ||
int color = (int) ((Math.sin(time) * 0.5f + 0.5f) * 255) << 16 | | ||
(int) ((Math.cos(time) * 0.5f + 0.5f) * 255) << 8 | | ||
128; | ||
int color = (int) ((Math.sin(time) * 0.5f + 0.5f) * 255) << 16 | ||
| (int) ((Math.cos(time) * 0.5f + 0.5f) * 255) << 8 | ||
| 128; | ||
RenderGlobal.drawOutlinedBoundingBox(p_147590_0_, color); | ||
}RenderGlobal.drawOutlinedBoundingBox(p_147590_0_, p_147590_1_); | ||
} | ||
RenderGlobal.drawOutlinedBoundingBox(p_147590_0_, p_147590_1_); | ||
} | ||
} |