mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Merge branch 'dev' of https://github.com/KAMKEEL/CustomNPC-Plus into dev
This commit is contained in:
commit
e330b517a8
1 file changed
+14
-9
+14
-9
@@ -277,17 +277,22 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetForBurst() {
|
||||
// Non-overlap: kill old entities before next burst creates new ones
|
||||
if (!burstOverlap) {
|
||||
cleanup();
|
||||
}
|
||||
// Clear reference so the next iteration creates fresh entities.
|
||||
// For overlap mode, old entities stay alive (tracked in burstEntities).
|
||||
entities = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExecute(EntityLivingBase caster, EntityLivingBase target) {
|
||||
// Create fresh entities if needed:
|
||||
// - entities == null: windup was skipped (burst without replay animations)
|
||||
// - isBurstRefire(): previous burst entities may still be alive,
|
||||
// so we must create new ones for each burst iteration
|
||||
if (entities == null || isBurstRefire()) {
|
||||
// Non-overlap burst refire: kill old entities before creating new ones
|
||||
if (isBurstRefire() && !burstOverlap && entities != null) {
|
||||
cleanup();
|
||||
}
|
||||
// Create entities if they don't exist yet.
|
||||
// They'll already exist if onWindUpTick ran (windup replay), otherwise we create here.
|
||||
if (entities == null) {
|
||||
entities = createAllEntities(caster, target);
|
||||
|
||||
// If there's a fire delay, put unfired entities in charging state
|
||||
|
||||
Reference in new issue
Block a user