mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 17:22:17 +00:00
Add Barrier Reflection!
This commit is contained in:
1 parent
b5534b4a39
commit
adf9cd7012
19 files changed
+792
-61
No files matched your search
@@ -515,22 +515,22 @@ public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
}
|
||||
|
||||
private void checkEntityCollision(double headX, double headY, double headZ) {
|
||||
double hitSize = headSize * 0.5;
|
||||
// Swept head hitbox prevents misses when beam head moves quickly between ticks.
|
||||
double prevHeadWorldX = startX + prevHeadOffsetX;
|
||||
double prevHeadWorldY = startY + prevHeadOffsetY;
|
||||
double prevHeadWorldZ = startZ + prevHeadOffsetZ;
|
||||
double hitSize = Math.max(0.05, headSize * 0.5);
|
||||
AxisAlignedBB hitBox = AxisAlignedBB.getBoundingBox(
|
||||
headX - hitSize, headY - hitSize, headZ - hitSize,
|
||||
headX + hitSize, headY + hitSize, headZ + hitSize
|
||||
Math.min(prevHeadWorldX, headX) - hitSize,
|
||||
Math.min(prevHeadWorldY, headY) - hitSize,
|
||||
Math.min(prevHeadWorldZ, headZ) - hitSize,
|
||||
Math.max(prevHeadWorldX, headX) + hitSize,
|
||||
Math.max(prevHeadWorldY, headY) + hitSize,
|
||||
Math.max(prevHeadWorldZ, headZ) + hitSize
|
||||
);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, hitBox);
|
||||
|
||||
for (EntityLivingBase entity : entities) {
|
||||
if (processEntityHit(entity, headX, headY, headZ)) {
|
||||
if (DEBUG_LOGGING) {
|
||||
LogWriter.info("[Beam] DEAD: Entity collision with " + entity.getClass().getSimpleName() + " at tick " + ticksExisted);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (processEntitiesInHitBox(hitBox, headX, headY, headZ) && DEBUG_LOGGING) {
|
||||
LogWriter.info("[Beam] DEAD: Entity collision at tick " + ticksExisted);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user