mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 19:39:07 +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
@@ -3,6 +3,7 @@ package kamkeel.npcs.entity;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.EventHooks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -344,6 +345,9 @@ public class EntityAbilityDisc extends EntityAbilityProjectile {
|
||||
MovingObjectPosition blockHit = worldObj.func_147447_a(currentPos, nextPos, false, true, false);
|
||||
|
||||
if (blockHit != null && blockHit.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
if (!worldObj.isRemote) {
|
||||
EventHooks.onEnergyProjectileBlockImpact(this, blockHit.blockX, blockHit.blockY, blockHit.blockZ);
|
||||
}
|
||||
hasHit = true;
|
||||
if (isExplosive()) {
|
||||
posX = blockHit.hitVec.xCoord;
|
||||
@@ -413,14 +417,34 @@ public class EntityAbilityDisc extends EntityAbilityProjectile {
|
||||
return discRadius;
|
||||
}
|
||||
|
||||
public void setDiscRadius(float radius) {
|
||||
this.discRadius = radius;
|
||||
}
|
||||
|
||||
public float getDiscThickness() {
|
||||
return discThickness;
|
||||
}
|
||||
|
||||
public void setDiscThickness(float thickness) {
|
||||
this.discThickness = thickness;
|
||||
}
|
||||
|
||||
public boolean isBoomerang() {
|
||||
return boomerang;
|
||||
}
|
||||
|
||||
public void setBoomerang(boolean boomerang) {
|
||||
this.boomerang = boomerang;
|
||||
}
|
||||
|
||||
public int getBoomerangDelay() {
|
||||
return boomerangDelay;
|
||||
}
|
||||
|
||||
public void setBoomerangDelay(int delay) {
|
||||
this.boomerangDelay = delay;
|
||||
}
|
||||
|
||||
public boolean isReturning() {
|
||||
return returning;
|
||||
}
|
||||
@@ -429,6 +453,10 @@ public class EntityAbilityDisc extends EntityAbilityProjectile {
|
||||
return vertical;
|
||||
}
|
||||
|
||||
public void setVertical(boolean vertical) {
|
||||
this.vertical = vertical;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the yaw angle (degrees) from motion vector for vertical disc orientation.
|
||||
* During charging, uses owner's facing direction.
|
||||
|
||||
Reference in new issue
Block a user