mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 23:52:19 +00:00
Fix Firing Energy Projectiles and Make Charging State purely visual
This commit is contained in:
1 parent
3a8f829de9
commit
18968bf7c7
18 files changed
+1086
-439
No files matched your search
@@ -83,6 +83,10 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
}
|
||||
}
|
||||
|
||||
public void setChargeDuration(int duration) {
|
||||
this.chargeDuration = duration;
|
||||
}
|
||||
|
||||
public float getChargeProgress() {
|
||||
if (chargeDuration <= 0) return 1.0f;
|
||||
return Math.min(1.0f, (float) chargeTick / chargeDuration);
|
||||
@@ -333,6 +337,24 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
readEnergyBaseNBT(nbt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export spawn NBT for non-world preview rendering sync.
|
||||
*/
|
||||
public final NBTTagCompound exportSpawnNBT() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeSpawnNBT(nbt);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import spawn NBT for non-world preview rendering sync.
|
||||
*/
|
||||
public final void importSpawnNBT(NBTTagCompound nbt) {
|
||||
if (nbt != null) {
|
||||
readSpawnNBT(nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSpawnData(ByteBuf buffer) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user