Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vidal committed 2026-03-09 18:44:38 -03:00
commit c7ef60136c
6 files changed
+68 -6

No files matched your search

+1 -1
View File
@@ -285,7 +285,7 @@ public abstract class AbstractNpcAPI {
public abstract IDamageSource getIDamageSource(IEntity<?> entity);
public abstract IEnergyController getEnergyController();
public abstract IEnergyHandler getEnergyHandler();
public abstract EventBus events();
@@ -11,7 +11,7 @@ import noppes.npcs.api.entity.IEnergyExplosion;
* Configure the entity, then call fire() (projectiles) or spawn() (zones/sweepers/panels)
* to place it in the world.
*/
public interface IEnergyController {
public interface IEnergyHandler {
// ==================== PROJECTILE CREATION ====================
@@ -57,10 +57,72 @@ public interface IEnergyBarrier<T extends Entity> extends IEnergyAbility<T> {
void setKnockbackStrength(float strength);
/**
* Returns whether this barrier absorbs damage on behalf of its owner.
* When absorbing is enabled, incoming damage to the barrier's owner is redirected
* to the barrier instead, subject to the absorb radius check.
*
* @return {@code true} if the barrier absorbs the owner's incoming damage
* @see #getAbsorbRadius()
*/
boolean isAbsorbing();
/**
* Sets whether this barrier absorbs damage on behalf of its owner.
* When absorbing is enabled, incoming damage to the barrier's owner is redirected
* to the barrier instead, subject to the absorb radius check.
*
* @param absorbing {@code true} to enable damage absorption for the owner
* @see #setAbsorbRadius(float)
*/
void setAbsorbing(boolean absorbing);
/**
* Gets the absorb radius for this barrier.
* The absorb radius determines the maximum distance from the barrier's current
* position at which the owner's incoming damage will still be redirected to the barrier.
* This check uses the barrier entity's live position, so it works correctly with
* moving barriers (following domes, moving walls, shields, etc.).
*
* <ul>
* <li>{@code -1} = No distance limit. Damage is always absorbed regardless of distance.</li>
* <li>{@code 0} = Uses the barrier's own geometric extent as the effective radius.
* <ul>
* <li>Domes: the dome radius (sphere radius in blocks).</li>
* <li>Panels: {@code (max(width, height) * 0.5 + 1.0) * 3}
* (i.e. {@code max(width, height) * 1.5 + 3.0} blocks).</li>
* </ul>
* </li>
* <li>Positive values = The owner must be within this many blocks of the barrier entity.</li>
* </ul>
*
* @return the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent
*/
float getAbsorbRadius();
/**
* Sets the absorb radius for this barrier.
* The absorb radius determines the maximum distance from the barrier's current
* position at which the owner's incoming damage will still be redirected to the barrier.
* This check uses the barrier entity's live position, so it works correctly with
* moving barriers (following domes, moving walls, shields, etc.).
*
* <ul>
* <li>{@code -1} = No distance limit. Damage is always absorbed regardless of distance.</li>
* <li>{@code 0} = Uses the barrier's own geometric extent as the effective radius.
* <ul>
* <li>Domes: the dome radius (sphere radius in blocks).</li>
* <li>Panels: {@code (max(width, height) * 0.5 + 1.0) * 3}
* (i.e. {@code max(width, height) * 1.5 + 3.0} blocks).</li>
* </ul>
* </li>
* <li>Positive values = The owner must be within this many blocks of the barrier entity.</li>
* </ul>
*
* @param radius the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent
*/
void setAbsorbRadius(float radius);
/**
* Returns the barrier type: 0=Dome, 1=Panel
* @return the barrier type ordinal
@@ -1,11 +1,11 @@
package noppes.npcs.api.entity;
import net.minecraft.entity.Entity;
import noppes.npcs.api.INbt;
import noppes.npcs.api.IEnergyHandler;
/**
* Represents a standalone energy explosion entity.
* Created via {@link noppes.npcs.api.IEnergyController#createExplosion}.
* Created via {@link IEnergyHandler#createExplosion}.
* Configure visual/damage properties, then call {@link #spawn()} to place in the world.
*
* When damage is set (&gt; 0), the explosion will deal area damage on the first tick
@@ -4,7 +4,7 @@ import net.minecraft.entity.Entity;
/**
* Entity-level interface for sweeper beam entities.
* Created via IEnergyController.createSweeper().
* Created via IEnergyHandler.createSweeper().
* Configure properties, then call spawn() to place in the world.
*/
public interface IEnergySweeper<T extends Entity> extends IEnergyAbility<T> {
+1 -1
View File
@@ -4,7 +4,7 @@ import net.minecraft.entity.Entity;
/**
* Entity-level interface for zone entities (Hazard and Trap).
* Created via IEnergyController.createHazard() or createTrap().
* Created via IEnergyHandler.createHazard() or createTrap().
* Configure properties, then call spawn() to place in the world.
*/
public interface IEnergyZone<T extends Entity> extends IEntity<T> {