mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 19:42:19 +00:00
Better API Handling for Scripting Energy Utilitizes / Damage Handling
This commit is contained in:
1 parent
7df1cfbfb9
commit
572a51ad32
10 files changed
+352
-2
No files matched your search
@@ -3,6 +3,7 @@ package kamkeel.npcs.entity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.EnergyController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyBarrierData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyDisplayData;
|
||||
@@ -227,6 +228,14 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
sourceAbility, (EntityLivingBase) owner, target,
|
||||
panelData.launchDamage, panelData.launchKnockback, 0.0f, dx, dz, 1.0f);
|
||||
}
|
||||
// Fallback: route through EnergyController for script-created entities with custom damage data
|
||||
if (!handled && customDamageData != null && owner instanceof EntityLivingBase) {
|
||||
double dx = target.posX - posX;
|
||||
double dz = target.posZ - posZ;
|
||||
handled = EnergyController.Instance.fireOnEnergyDamage(
|
||||
this, (EntityLivingBase) owner, target,
|
||||
panelData.launchDamage, panelData.launchKnockback, 0.0f, dx, dz, 1.0f, customDamageData);
|
||||
}
|
||||
|
||||
if (!handled) {
|
||||
if (owner instanceof EntityNPCInterface) {
|
||||
@@ -655,6 +664,15 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
return panelData;
|
||||
}
|
||||
|
||||
public void setPanelYaw(float yaw) {
|
||||
this.panelYaw = yaw;
|
||||
this.prevPanelYaw = yaw;
|
||||
}
|
||||
|
||||
public void setMode(PanelMode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user