forked from Sk1erLLC/Patcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: stop rendering bounding boxes of hidden arrows
closes Sk1erLLC#125
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/club/sk1er/patcher/mixins/features/RenderManagerMixin_CancelArrowRender.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,20 @@ | ||
package club.sk1er.patcher.mixins.features; | ||
|
||
import club.sk1er.patcher.hooks.RenderArrowHook; | ||
import net.minecraft.client.renderer.entity.RenderManager; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
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(RenderManager.class) | ||
public class RenderManagerMixin_CancelArrowRender { | ||
@Inject(method = "renderDebugBoundingBox", at = @At("HEAD"), cancellable = true) | ||
public void patcher$cancelArrowBoundingBoxRendering(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { | ||
if (entityIn instanceof EntityArrow && RenderArrowHook.cancelRendering((EntityArrow) entityIn)) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
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