Skip to content

Commit

Permalink
change: stop rendering bounding boxes of hidden arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Jan 2, 2023
1 parent 576e74b commit b645953
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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();
}
}
}
5 changes: 3 additions & 2 deletions src/main/resources/patcher.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"bugfixes.crashes.ServerListEntryNormalMixin_ResolveCrash",
"bugfixes.crashes.ServerSelectionListMixin_ResolveCrash",
"bugfixes.crashes.WorldRendererMixin_ResolveCrash",
"bugfixes.forge.BlockPaneMixin_VanillaPanes",
"bugfixes.forge.ClientCommandHandlerMixin_CaseCommands",
"bugfixes.forge.BlockChestMixin_VanillaSlabChests",
"bugfixes.forge.BlockMixin_VanillaSlabChests",
"bugfixes.forge.BlockPaneMixin_VanillaPanes",
"bugfixes.forge.ClientCommandHandlerMixin_CaseCommands",
"bugfixes.modelfixes.ModelPlayerMixin_FixedTransformations",
"bugfixes.modelfixes.ModelSkeletonMixin_FixedHeldItemTransformations",
"bugfixes.modelfixes.ModelVillagerMixin_ResolveRobeHeight",
Expand Down Expand Up @@ -160,6 +160,7 @@
"features.RenderItemFrameMixin_NametagBackground",
"features.RenderItemFrameMixin_NametagShadow",
"features.RenderLightningBoltMixin_CancelRender",
"features.RenderManagerMixin_CancelArrowRender",
"features.ScreenShotHelperMixin_ScreenshotManager",
"features.TileEntityEnchantmentTableRendererMixin_CancelRender",
"features.TileEntityEndPortalRendererMixins_CancelRender",
Expand Down

0 comments on commit b645953

Please sign in to comment.