mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-17 04:05:13 +00:00
Add energy projectile types and events: implement IEnergyOrb, IEnergyBeam, IEnergyDisc, and IEnergyLaser interfaces, along with their respective script handlers and event hooks
This commit is contained in:
1 parent
66fff09d20
commit
efa8721d36
10 files changed
+402
-5
No files matched your search
@@ -1,35 +1,61 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
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.
|
||||
*/
|
||||
public interface IEnergyProjectile<T extends Entity> extends IEntity<T> {
|
||||
|
||||
// ==================== OWNER & TARGET ====================
|
||||
|
||||
public interface IEnergyProjectile {
|
||||
int getOwnerEntityId();
|
||||
|
||||
IEntity getOwner();
|
||||
|
||||
void setOwner(IEntity owner);
|
||||
|
||||
int getTargetEntityId();
|
||||
|
||||
IEntity getTarget();
|
||||
|
||||
void setTarget(IEntity target);
|
||||
|
||||
// ==================== SIZE ====================
|
||||
|
||||
float getSize();
|
||||
|
||||
double getMotionX();
|
||||
void setSize(float size);
|
||||
|
||||
double getMotionY();
|
||||
|
||||
double getMotionZ();
|
||||
// ==================== 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);
|
||||
|
||||
float getRotationSpeed();
|
||||
|
||||
void setRotationSpeed(float speed);
|
||||
|
||||
// ==================== INTERPOLATION (READ-ONLY) ====================
|
||||
|
||||
float getInterpolatedRotationX(float partialTicks);
|
||||
|
||||
float getInterpolatedRotationY(float partialTicks);
|
||||
@@ -38,38 +64,80 @@ public interface IEnergyProjectile {
|
||||
|
||||
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();
|
||||
|
||||
void setMaxDistance(float distance);
|
||||
|
||||
int getMaxLifetime();
|
||||
|
||||
void setMaxLifetime(int ticks);
|
||||
|
||||
// ==================== COMBAT ====================
|
||||
|
||||
float getDamage();
|
||||
|
||||
void setDamage(float damage);
|
||||
|
||||
float getKnockback();
|
||||
|
||||
void setKnockback(float knockback);
|
||||
|
||||
float getKnockbackUp();
|
||||
|
||||
void setKnockbackUp(float knockbackUp);
|
||||
|
||||
boolean isExplosive();
|
||||
|
||||
void setExplosive(boolean explosive);
|
||||
|
||||
float getExplosionRadius();
|
||||
|
||||
void setExplosionRadius(float radius);
|
||||
|
||||
float getExplosionDamageFalloff();
|
||||
|
||||
void setExplosionDamageFalloff(float falloff);
|
||||
|
||||
// ==================== MOVEMENT ====================
|
||||
|
||||
float getSpeed();
|
||||
|
||||
void setSpeed(float speed);
|
||||
|
||||
boolean isHoming();
|
||||
|
||||
void setHoming(boolean homing);
|
||||
|
||||
float getHomingStrength();
|
||||
|
||||
void setHomingStrength(float strength);
|
||||
|
||||
float getHomingRange();
|
||||
|
||||
void setHomingRange(float range);
|
||||
|
||||
// ==================== ANCHOR ====================
|
||||
|
||||
int getAnchor();
|
||||
|
||||
float getAnchorOffsetX();
|
||||
@@ -78,9 +146,54 @@ public interface IEnergyProjectile {
|
||||
|
||||
float getAnchorOffsetZ();
|
||||
|
||||
// ==================== POSITION ====================
|
||||
|
||||
double getStartX();
|
||||
|
||||
double getStartY();
|
||||
|
||||
double getStartZ();
|
||||
|
||||
// ==================== STATE ====================
|
||||
|
||||
boolean hasHit();
|
||||
|
||||
boolean isCharging();
|
||||
|
||||
float getChargeProgress();
|
||||
|
||||
/**
|
||||
* Returns the energy projectile sub-type.
|
||||
* 0=Orb, 1=Beam, 2=Disc, 3=Laser
|
||||
*/
|
||||
int getEnergyType();
|
||||
|
||||
// ==================== FIRE / LAUNCH ====================
|
||||
|
||||
/**
|
||||
* Spawns the projectile in the world (if not yet spawned) and starts it moving toward the target entity.
|
||||
*/
|
||||
void fire(IEntity target);
|
||||
|
||||
/**
|
||||
* Spawns the projectile in the world (if not yet spawned) and starts it moving toward the specified coordinates.
|
||||
*/
|
||||
void fire(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Spawns the projectile in the world (if not yet spawned) and starts it moving in the specified direction.
|
||||
*/
|
||||
void fire(float yaw, float pitch);
|
||||
|
||||
/**
|
||||
* Sets the owner, positions the projectile at the caster's eye level, and fires in the caster's look direction.
|
||||
* Convenience method similar to how fireKiAttack works.
|
||||
*/
|
||||
void fire(IEntityLivingBase caster);
|
||||
|
||||
/**
|
||||
* Sets the owner, positions the projectile at the caster's eye level, and fires toward the target entity.
|
||||
*/
|
||||
void fire(IEntityLivingBase caster, IEntity target);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user