mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 19:19:43 +00:00
Fix Domes
This commit is contained in:
1 parent
b3357a2751
commit
a18503dfe9
7 files changed
+80
-144
No files matched your search
@@ -153,13 +153,13 @@ public class ServerEventsHandler {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void barrierDamageProtection(LivingAttackEvent event) {
|
||||
public void barrierAbsorbDamage(LivingAttackEvent event) {
|
||||
if (event.entityLiving == null || event.entityLiving.worldObj == null || event.entityLiving.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
EntityEnergyBarrier barrier = EntityEnergyBarrier.getProtectingBarrier(event.entityLiving);
|
||||
if (barrier != null && barrier.isDamageFromOutside(event.source)) {
|
||||
// Redirect the damage to the barrier instead of preventing it
|
||||
EntityEnergyBarrier barrier = EntityEnergyBarrier.getAbsorbingBarrier(event.entityLiving);
|
||||
if (barrier != null) {
|
||||
// Redirect the caster's damage to their barrier
|
||||
barrier.absorbDamage(event.ammount);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
@@ -89,6 +89,14 @@ public class ScriptEnergyBarrier<T extends EntityEnergyBarrier> extends ScriptEn
|
||||
entity.getBarrierData().defaultMultiplier = multiplier;
|
||||
}
|
||||
|
||||
public boolean isSolid() {
|
||||
return entity.getBarrierData().solid;
|
||||
}
|
||||
|
||||
public void setSolid(boolean solid) {
|
||||
entity.getBarrierData().solid = solid;
|
||||
}
|
||||
|
||||
public boolean isKnockbackEnabled() {
|
||||
return entity.getBarrierData().knockbackEnabled;
|
||||
}
|
||||
@@ -105,12 +113,12 @@ public class ScriptEnergyBarrier<T extends EntityEnergyBarrier> extends ScriptEn
|
||||
entity.getBarrierData().knockbackStrength = strength;
|
||||
}
|
||||
|
||||
public int getKnockbackTarget() {
|
||||
return entity.getBarrierData().knockbackTarget;
|
||||
public boolean isAbsorbing() {
|
||||
return entity.getBarrierData().absorbing;
|
||||
}
|
||||
|
||||
public void setKnockbackTarget(int target) {
|
||||
entity.getBarrierData().knockbackTarget = target;
|
||||
public void setAbsorbing(boolean absorbing) {
|
||||
entity.getBarrierData().absorbing = absorbing;
|
||||
}
|
||||
|
||||
public int getBarrierType() {
|
||||
|
||||
Reference in new issue
Block a user