▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Hitbox Api
Hitbox Api

Hitbox Api

Add more colliders for Minecraft

545
13

Hitbox API

Adding more common collider for Minecraft

  • Oriented Bounding Box (OBB)
  • Sphere
  • Capsule
  • Ray
  • Compound
    • Multiple collider can be combined into one.
    • Composite collider can be nested.

How to Use

In any place where collision detection is needed, create a collider object and use the methods in ColliderUtil to determine if a collider has occurred.

For entities (Entity), you can achieve collider box caching by attaching HitboxDataAttachments#COLLISION. The cached collider can be rendered by pressing F3 + B. Note that this Data does not have a persistence implementation.

Performance

Testing Method

  • JMH Benchmark

Testing Environment

  • CPU: AMD R5 5600G
  • Memory: 32GB
  • JDK: Microsoft OpenJDK 21.0

Testing Settings

  • Warm-up Rounds: 5
  • Test Rounds: 5

Testing Items

  • Collision detection of the same type of collider
ColliderScoreErrorUnit
Axis-Aligned Bounding Box3561837865.930157982649.213ops/s
Capsule22350681.198238993.658ops/s
Rotated Capsule16842309.523103959.918ops/s
Oriented Bounding Box5528493.22464548.996ops/s
Rotated Oriented Bounding Box4648963.750111369.535ops/s
Sphere119556589.7051711146.560ops/s

Note: Higher scores indicate better performance. Rotated means the collider is rotated and the relevant vectors are recalculated.

add collider for entity

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Детали

Лицензия:GPL-3.0-or-later
Опубликован:1 год назад
Обновлён:1 год назад
Главная