修复了波塞克散射模式伤害
This commit is contained in:
parent
cc8bbcdade
commit
537ca31925
3 changed files with 4 additions and 4 deletions
|
@ -122,13 +122,13 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
|||
|
||||
// 延迟补偿
|
||||
if (entity instanceof ServerPlayer && this.shooter != null) {
|
||||
int ping = (int) Math.floor((((ServerPlayer) this.shooter).latency / 1000.0) * 20.0 + 3.5);
|
||||
int ping = (int) Math.floor((((ServerPlayer) this.shooter).latency / 1000.0) * 20.0 + 4.5);
|
||||
boundingBox = BoundingBoxManager.getBoundingBox((Player) entity, ping);
|
||||
}
|
||||
boundingBox = boundingBox.expandTowards(0, expandHeight, 0);
|
||||
|
||||
Vec3 hitPos = boundingBox.clip(startVec, endVec).orElse(null);
|
||||
Vec3 grownHitPos = boundingBox.inflate(0.2, 0, 0.2).clip(startVec, endVec).orElse(null);
|
||||
Vec3 grownHitPos = boundingBox.inflate(0.3, 2, 0.3).clip(startVec, endVec).orElse(null);
|
||||
if (hitPos == null && grownHitPos != null) {
|
||||
HitResult result = rayTraceBlocks(this.level(), new ClipContext(startVec, grownHitPos, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this), IGNORE_LEAVES);
|
||||
if (result.getType() == HitResult.Type.BLOCK) {
|
||||
|
|
|
@ -50,7 +50,7 @@ public class BowlooseProcedure {
|
|||
}
|
||||
}.getArrow(projectileLevel, entity, (float) (0.5 * (1 + 0.05 * usehand.getOrCreateTag().getDouble("level"))), 0, (byte) 2);
|
||||
_entityToSpawn.setPos(entity.getX(), entity.getEyeY() - 0.1, entity.getZ());
|
||||
_entityToSpawn.shoot(entity.getLookAngle().x, entity.getLookAngle().y, entity.getLookAngle().z, (float) (4 * power), (float) 0.05);
|
||||
_entityToSpawn.shoot(entity.getLookAngle().x, entity.getLookAngle().y, entity.getLookAngle().z, (float) (4 * power), (float) 0.02);
|
||||
projectileLevel.addFreshEntity(_entityToSpawn);
|
||||
}
|
||||
if (!entity.level().isClientSide() && entity.getServer() != null) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BulletFireNormalProcedure {
|
|||
ProjectileEntity projectile = new ProjectileEntity(entity.level(), living, damage, headshot);
|
||||
|
||||
projectile.setPos((living.getX() + (-0.5) * living.getLookAngle().x), (living.getEyeY() - 0.1 + (-0.5) * living.getLookAngle().y), (living.getZ() + (-0.5) * living.getLookAngle().z));
|
||||
projectile.shoot(living.getLookAngle().x, living.getLookAngle().y, living.getLookAngle().z, velocity, 2);
|
||||
projectile.shoot(living.getLookAngle().x, living.getLookAngle().y, living.getLookAngle().z, velocity, 2.5f);
|
||||
entity.level().addFreshEntity(projectile);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue