mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-15 02:04:44 +00:00
IEnergy + IBarriers
This commit is contained in:
1 parent
efa8721d36
commit
3d648425fa
8 files changed
+235
-49
No files matched your search
@@ -21,6 +21,10 @@ public interface IEnergyDisplayData {
|
||||
|
||||
void setOuterColorAlpha(float outerColorAlpha);
|
||||
|
||||
float getInnerAlpha();
|
||||
|
||||
void setInnerAlpha(float innerAlpha);
|
||||
|
||||
float getRotationSpeed();
|
||||
|
||||
void setRotationSpeed(float rotationSpeed);
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Base interface for all energy ability entities (Projectiles, Barriers).
|
||||
* Contains shared display, lightning, owner, and charging properties.
|
||||
*/
|
||||
public interface IEnergyAbility<T extends Entity> extends IEntity<T> {
|
||||
|
||||
// ==================== OWNER ====================
|
||||
|
||||
int getOwnerEntityId();
|
||||
|
||||
IEntity getOwner();
|
||||
|
||||
// ==================== DISPLAY ====================
|
||||
|
||||
int getInnerColor();
|
||||
|
||||
void setInnerColor(int color);
|
||||
|
||||
float getInnerAlpha();
|
||||
|
||||
void setInnerAlpha(float alpha);
|
||||
|
||||
int getOuterColor();
|
||||
|
||||
void setOuterColor(int color);
|
||||
|
||||
boolean isOuterColorEnabled();
|
||||
|
||||
void setOuterColorEnabled(boolean enabled);
|
||||
|
||||
float getOuterColorWidth();
|
||||
|
||||
void setOuterColorWidth(float width);
|
||||
|
||||
float getOuterColorAlpha();
|
||||
|
||||
void setOuterColorAlpha(float alpha);
|
||||
|
||||
// ==================== LIGHTNING ====================
|
||||
|
||||
boolean hasLightningEffect();
|
||||
|
||||
void setLightningEffect(boolean enabled);
|
||||
|
||||
float getLightningDensity();
|
||||
|
||||
void setLightningDensity(float density);
|
||||
|
||||
float getLightningRadius();
|
||||
|
||||
void setLightningRadius(float radius);
|
||||
|
||||
int getLightningFadeTime();
|
||||
|
||||
void setLightningFadeTime(int ticks);
|
||||
|
||||
// ==================== STATE ====================
|
||||
|
||||
boolean isCharging();
|
||||
|
||||
float getChargeProgress();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Base interface for energy barrier entities (Dome, Panel).
|
||||
* Barriers are defensive structures that block incoming energy projectiles.
|
||||
* Extends IEnergyAbility for shared display/lightning/owner/charging methods.
|
||||
*/
|
||||
public interface IEnergyBarrier<T extends Entity> extends IEnergyAbility<T> {
|
||||
|
||||
// ==================== HEALTH ====================
|
||||
|
||||
float getCurrentHealth();
|
||||
|
||||
void setCurrentHealth(float health);
|
||||
|
||||
float getHealthPercent();
|
||||
|
||||
float getMaxHealth();
|
||||
|
||||
void setMaxHealth(float maxHealth);
|
||||
|
||||
boolean isUseHealth();
|
||||
|
||||
void setUseHealth(boolean useHealth);
|
||||
|
||||
// ==================== DURATION ====================
|
||||
|
||||
int getDuration();
|
||||
|
||||
void setDuration(int ticks);
|
||||
|
||||
boolean isUseDuration();
|
||||
|
||||
void setUseDuration(boolean useDuration);
|
||||
|
||||
// ==================== STATE (BARRIER-SPECIFIC) ====================
|
||||
|
||||
int getTicksAlive();
|
||||
|
||||
// ==================== BARRIER ====================
|
||||
|
||||
float getDefaultMultiplier();
|
||||
|
||||
void setDefaultMultiplier(float multiplier);
|
||||
|
||||
boolean isKnockbackEnabled();
|
||||
|
||||
void setKnockbackEnabled(boolean enabled);
|
||||
|
||||
float getKnockbackStrength();
|
||||
|
||||
void setKnockbackStrength(float strength);
|
||||
|
||||
int getKnockbackTarget();
|
||||
|
||||
void setKnockbackTarget(int target);
|
||||
|
||||
/**
|
||||
* Returns the barrier type: 0=Dome, 1=Panel
|
||||
*/
|
||||
int getBarrierType();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Represents an energy dome barrier - a spherical shield centered on the caster.
|
||||
*/
|
||||
public interface IEnergyDome<T extends Entity> extends IEnergyBarrier<T> {
|
||||
|
||||
float getDomeRadius();
|
||||
|
||||
void setDomeRadius(float radius);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Represents an energy panel barrier - a flat rectangular shield (Wall or Shield mode).
|
||||
*/
|
||||
public interface IEnergyPanel<T extends Entity> extends IEnergyBarrier<T> {
|
||||
|
||||
float getPanelWidth();
|
||||
|
||||
void setPanelWidth(float width);
|
||||
|
||||
float getPanelHeight();
|
||||
|
||||
void setPanelHeight(float height);
|
||||
|
||||
float getPanelYaw();
|
||||
|
||||
/**
|
||||
* Panel mode: 0=PLACED, 1=HELD, 2=LAUNCHED
|
||||
*/
|
||||
int getPanelMode();
|
||||
|
||||
boolean isLaunched();
|
||||
}
|
||||
@@ -4,16 +4,12 @@ import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Represents an energy projectile entity (Orb, Beam, Disc, Laser).
|
||||
* Extends IEntity so scripts have full access to both entity and energy-specific methods.
|
||||
* Extends IEnergyAbility for shared display/lightning/owner/charging methods.
|
||||
*/
|
||||
public interface IEnergyProjectile<T extends Entity> extends IEntity<T> {
|
||||
public interface IEnergyProjectile<T extends Entity> extends IEnergyAbility<T> {
|
||||
|
||||
// ==================== OWNER & TARGET ====================
|
||||
|
||||
int getOwnerEntityId();
|
||||
|
||||
IEntity getOwner();
|
||||
|
||||
void setOwner(IEntity owner);
|
||||
|
||||
int getTargetEntityId();
|
||||
@@ -28,27 +24,7 @@ public interface IEnergyProjectile<T extends Entity> extends IEntity<T> {
|
||||
|
||||
void setSize(float size);
|
||||
|
||||
// ==================== DISPLAY ====================
|
||||
|
||||
int getInnerColor();
|
||||
|
||||
void setInnerColor(int color);
|
||||
|
||||
int getOuterColor();
|
||||
|
||||
void setOuterColor(int color);
|
||||
|
||||
boolean isOuterColorEnabled();
|
||||
|
||||
void setOuterColorEnabled(boolean enabled);
|
||||
|
||||
float getOuterColorWidth();
|
||||
|
||||
void setOuterColorWidth(float width);
|
||||
|
||||
float getOuterColorAlpha();
|
||||
|
||||
void setOuterColorAlpha(float alpha);
|
||||
// ==================== DISPLAY (PROJECTILE-SPECIFIC) ====================
|
||||
|
||||
float getRotationSpeed();
|
||||
|
||||
@@ -64,24 +40,6 @@ public interface IEnergyProjectile<T extends Entity> extends IEntity<T> {
|
||||
|
||||
float getInterpolatedSize(float partialTicks);
|
||||
|
||||
// ==================== LIGHTNING ====================
|
||||
|
||||
boolean hasLightningEffect();
|
||||
|
||||
void setLightningEffect(boolean enabled);
|
||||
|
||||
float getLightningDensity();
|
||||
|
||||
void setLightningDensity(float density);
|
||||
|
||||
float getLightningRadius();
|
||||
|
||||
void setLightningRadius(float radius);
|
||||
|
||||
int getLightningFadeTime();
|
||||
|
||||
void setLightningFadeTime(int ticks);
|
||||
|
||||
// ==================== LIFESPAN ====================
|
||||
|
||||
float getMaxDistance();
|
||||
@@ -158,10 +116,6 @@ public interface IEnergyProjectile<T extends Entity> extends IEntity<T> {
|
||||
|
||||
boolean hasHit();
|
||||
|
||||
boolean isCharging();
|
||||
|
||||
float getChargeProgress();
|
||||
|
||||
/**
|
||||
* Returns the energy projectile sub-type.
|
||||
* 0=Orb, 1=Beam, 2=Disc, 3=Laser
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Represents an energy slicer projectile - a thin, wide blade that slices through targets.
|
||||
*/
|
||||
public interface IEnergySlicer<T extends Entity> extends IEnergyProjectile<T> {
|
||||
|
||||
float getSliceWidth();
|
||||
void setSliceWidth(float width);
|
||||
|
||||
float getSliceThickness();
|
||||
void setSliceThickness(float thickness);
|
||||
|
||||
boolean isPiercing();
|
||||
void setPiercing(boolean piercing);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package noppes.npcs.api.event;
|
||||
|
||||
import noppes.npcs.api.entity.IEnergyBarrier;
|
||||
import noppes.npcs.api.entity.IEnergyProjectile;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
|
||||
public interface IEnergyBarrierEvent extends ICustomNPCsEvent {
|
||||
|
||||
IEnergyBarrier getBarrier();
|
||||
|
||||
IEntity getOwner();
|
||||
|
||||
/**
|
||||
* @hookName energyBarrierSpawned
|
||||
*/
|
||||
interface SpawnedEvent extends IEnergyBarrierEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @hookName energyBarrierTick
|
||||
*/
|
||||
interface UpdateEvent extends IEnergyBarrierEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @hookName energyBarrierHit
|
||||
*/
|
||||
interface HitEvent extends IEnergyBarrierEvent {
|
||||
IEnergyProjectile getProjectile();
|
||||
|
||||
float getDamage();
|
||||
|
||||
void setDamage(float damage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hookName energyBarrierDestroyed
|
||||
*/
|
||||
interface DestroyedEvent extends IEnergyBarrierEvent {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user