1515import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
1616
1717//#if MC >=1.21.5
18+ import net .minecraft .client .render .entity .state .EntityHitbox ;
19+ //#endif
20+
21+ //#if MC >=1.16.5
1822import net .minecraft .client .util .math .MatrixStack ;
1923import net .minecraft .client .render .VertexConsumer ;
2024import net .minecraft .client .render .VertexConsumerProvider ;
21- import net .minecraft .client .render .entity .state .EntityHitbox ;
2225import org .spongepowered .asm .mixin .Unique ;
2326//#endif
2427
2528@ Mixin (EntityRenderDispatcher .class )
2629public abstract class MixinRenderManager {
27- //#if MC >=1.21.5
30+ //#if MC >=1.21.4
2831 @ Unique
2932 private static ThreadLocal <Entity > polyhitbox$entity = ThreadLocal .withInitial (() -> null );
3033 //#endif
@@ -45,10 +48,14 @@ public abstract class MixinRenderManager {
4548 //#if MC >=1.21.5
4649 EntityHitbox entityHitbox ,
4750 //#else
48- //$$ Entity entity,
49- //$$ float tickDelta,
51+ //$$ Entity entity,
52+ //$$ float tickDelta,
53+ //#endif
54+ //#if MC >=1.21.1
55+ //$$ float offsetX, float offsetY, float offsetZ,
5056 //#endif
51- CallbackInfo ci ) {
57+ CallbackInfo ci
58+ ) {
5259 //#else
5360 //$$ private void polyhitbox$customRendering(Entity entity, double offsetX, double offsetY, double offsetZ, float yaw, float tickDelta, CallbackInfo ci) {
5461 //#endif
@@ -61,34 +68,37 @@ public abstract class MixinRenderManager {
6168
6269 //#if MC >=1.21.5
6370 Entity entity = polyhitbox$entity .get ();
64- float offsetX = entityHitbox .comp_3855 ();
65- float offsetY = entityHitbox .comp_3856 ();
66- float offsetZ = entityHitbox .comp_3857 ();
67- float collisionBorderSize = 0.0F ; /// TODO/NOTE: Doesn't exist?
68- float width = entity .getWidth ();
71+ OmniVec3d offset = new OmniVec3d (entityHitbox .comp_3855 (), entityHitbox .comp_3856 (), entityHitbox .comp_3857 ());
6972 //#else
70- //$$ float collisionBorderSize = entity.getCollisionBorderSize();
71- //$$ float width = entity.width;
73+ //$$ OmniVec3d offset = OmniVec3d.ZERO;
7274 //#endif
75+
76+ OmniVec3d entityPosition = new OmniVec3d (
77+ //#if MC >=1.16.5
78+ entity .getX (), entity .getY (), entity .getZ ()
79+ //#else
80+ //$$ entity.x, entity.y, entity.z
81+ //#endif
82+ );
7383 OmniVec3d lookVec = new OmniVec3d (entity .getRotationVector ());
84+ OmniAABB entityAABB = new OmniAABB (entity .getBoundingBox ());
7485
7586 HitboxRendererKt .renderHitbox (
7687 stack ,
77- new OmniVec3d (offsetX , offsetY , offsetZ ),
78- new OmniVec3d (
79- //#if MC >=1.16.5
80- entity .getX (), entity .getY (), entity .getZ ()
81- //#else
82- //$$ entity.x, entity.y, entity.z
83- //#endif
84- ),
88+ offset ,
89+ entityPosition ,
8590 lookVec ,
8691 entity .getStandingEyeHeight (),
8792 entity instanceof LivingEntity ,
8893 entity == OmniClient .get ().targetedEntity ,
89- width ,
90- collisionBorderSize ,
91- new OmniAABB (entity .getBoundingBox ())
94+ //#if MC >=1.16.5
95+ entity .getWidth (),
96+ 0.0F , // TODO/NOTE: Doesn't exist?
97+ //#else
98+ //$$ entity.width,
99+ //$$ entity.getCollisionBorderSize(),
100+ //#endif
101+ entityAABB
92102 );
93103 }
94104
0 commit comments