mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +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
1ed012331b
commit
071d89cc15
23 files changed
+1363
-94
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package noppes.npcs.scripted.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.AttributeController;
|
||||
import kamkeel.npcs.entity.EntityAbilityProjectile;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.packets.data.AchievementPacket;
|
||||
import kamkeel.npcs.network.packets.data.ChatAlertPacket;
|
||||
@@ -31,6 +32,7 @@ import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IScreenSize;
|
||||
import noppes.npcs.api.ITimers;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.entity.IEnergyProjectile;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.gui.ICustomGui;
|
||||
@@ -933,4 +935,13 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
public String getFormattedCurrencyBalance() {
|
||||
return getData().tradeData.formatBalance();
|
||||
}
|
||||
|
||||
public IEnergyProjectile[] getActiveEnergyProjectiles() {
|
||||
List<EntityAbilityProjectile> entities = EntityAbilityProjectile.getActiveProjectiles(player.getEntityId());
|
||||
IEnergyProjectile[] result = new IEnergyProjectile[entities.size()];
|
||||
for (int i = 0; i < entities.size(); i++) {
|
||||
result[i] = (IEnergyProjectile) NpcAPI.Instance().getIEntity(entities.get(i));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user