mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 02:39:05 +00:00
Reflection Barrier Fixes
This commit is contained in:
1 parent
92cfbbcc9d
commit
47ebc2889f
8 files changed
+288
-1
No files matched your search
@@ -395,6 +395,32 @@ public class EntityAbilityDisc extends EntityEnergyProjectile {
|
||||
return lastTravelYaw;
|
||||
}
|
||||
|
||||
// ==================== REFLECTION ====================
|
||||
|
||||
@Override
|
||||
protected boolean reflectFromBarrier(EntityAbilityBarrier barrier, float reflectStrengthPct) {
|
||||
boolean reflected = super.reflectFromBarrier(barrier, reflectStrengthPct);
|
||||
if (reflected) {
|
||||
// Disable boomerang on reflected discs — the original owner is no longer
|
||||
// relevant and the return-to-owner logic causes erratic flight paths.
|
||||
this.boomerang = false;
|
||||
this.returning = false;
|
||||
}
|
||||
return reflected;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeProjectileReflectionData(NBTTagCompound nbt) {
|
||||
nbt.setBoolean("Boomerang", boomerang);
|
||||
nbt.setBoolean("Returning", returning);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyProjectileReflectionData(NBTTagCompound nbt) {
|
||||
boomerang = nbt.getBoolean("Boomerang");
|
||||
returning = nbt.getBoolean("Returning");
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user