refactor: simplify ChainResolver and RayCaster interfaces, enhance ChainDamageApplier logic
- Updated ChainResolver to remove unused shooterOrigin and shooterDirection parameters, streamlining the resolve method. - Modified RayCaster interface to reflect changes in method signature, focusing on maxBlocks only. - Enhanced ChainDamageApplier to utilize a new CauseIndexHolder for resolving the PHYSICAL damage cause index, improving clarity and performance. - Refactored ChainDamageApplier.apply method to use HytaleEntityAdapter for target references, ensuring correct damage application. - Adjusted tests in ChainResolverTest and ChainDamageApplierTest to align with the new method signatures and logic. Tests: All tests passing. Build: ./gradlew clean build successful.
This commit is contained in:
@@ -2,8 +2,8 @@ package com.mythlane.chainlightning.chain;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/** SAM that returns the first entity hit along a ray, or empty. */
|
||||
/** SAM that returns the first entity along the caster's look ray, or empty. */
|
||||
@FunctionalInterface
|
||||
public interface RayCaster {
|
||||
Optional<ChainEntity> firstHit(Vec3 origin, Vec3 direction, double maxBlocks);
|
||||
Optional<ChainEntity> firstHit(double maxBlocks);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user