Skip to content

Commit e5d7a36

Browse files
committed
Fix 1.8
1 parent 65c2818 commit e5d7a36

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/main/java/org/polyfrost/polyhitbox/mixin/MixinRenderManager.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ public abstract class MixinRenderManager {
7777
//$$ OmniVec3d offset = OmniVec3d.ZERO;
7878
//#endif
7979

80-
OmniVec3d entityPosition = new OmniVec3d(entity.getPos());
80+
OmniVec3d entityPosition = new OmniVec3d(
81+
//#if MC >=1.16.5
82+
entity.getPos()
83+
//#else
84+
//$$ entity.posX, entity.posY, entity.posZ
85+
//#endif
86+
);
8187
OmniVec3d lookVec = new OmniVec3d(entity.getRotationVector());
8288
OmniAABB entityAABB = new OmniAABB(entity.getBoundingBox());
8389

src/main/kotlin/org/polyfrost/polyhitbox/HitboxInfo.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class HitboxInfo(private val id: String) {
7777
_tree = value
7878
}
7979

80-
8180
inner class ElementInfo(
8281
isShown: Boolean,
8382
initialColor: PolyColor,

src/main/kotlin/org/polyfrost/polyhitbox/HitboxRenderer.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import dev.deftu.omnicore.api.data.shape.OmniVoxelShapes
1616
import dev.deftu.omnicore.api.data.vec.OmniVec3d
1717
import dev.deftu.omnicore.api.identifierOrThrow
1818
import dev.deftu.omnicore.api.math.OmniVector3f
19+
import net.minecraft.entity.Entity
1920
import kotlin.math.abs
2021

2122
val STRIPPLE_PATTERN: Short = 0xAAAA.toShort()
@@ -180,4 +181,14 @@ private fun renderOutlineBox(
180181
val buffer = pipeline.createBufferBuilder()
181182
OmniShapeRenderer.SHAPE_OUTLINE.render(buffer, stack, OmniVoxelShapes.cuboid(boundingBox).simplify(), color)
182183
buffer.buildOrNull()?.drawAndClose(pipeline, builder)
184+
}
185+
186+
private fun getEntityId(entity: Entity): String? {
187+
//#if MC >= 1.16.5
188+
val entityType = entity.type.toString()
189+
val type = entityType.substring(entityType.lastIndexOf("."), entityType.length).replace(".", "")
190+
//#else
191+
//$$ val type = EntityList.getEntityString(entity) ?: return null
192+
//#endif
193+
return type
183194
}

0 commit comments

Comments
 (0)