diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch new file mode 100644 index 0000000000..4305a3484d --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch @@ -0,0 +1,156 @@ +--- a/net/minecraft/world/entity/projectile/EvokerFangs.java ++++ b/net/minecraft/world/entity/projectile/EvokerFangs.java +@@ -19,7 +19,7 @@ + public static final int ATTACK_DURATION = 20; + public static final int LIFE_OFFSET = 2; + public static final int ATTACK_TRIGGER_TICKS = 14; +- private int warmupDelayTicks; ++ public int warmupDelayTicks; + private boolean sentSpikeEvent; + private int lifeTicks; + private boolean clientSideAttackStarted; +@@ -28,31 +28,29 @@ + @Nullable + private UUID ownerUUID; + +- public EvokerFangs(EntityType<? extends EvokerFangs> entitytype, Level level) { +- super(entitytype, level); ++ public EvokerFangs(EntityType<? extends EvokerFangs> entityType, Level level) { ++ super(entityType, level); + this.lifeTicks = 22; + } + +- public EvokerFangs(Level level, double d0, double d1, double d2, float f, int i, LivingEntity livingentity) { ++ public EvokerFangs(Level level, double x, double d1, double y, float f, int z, LivingEntity entityliving) { + this(EntityType.EVOKER_FANGS, level); +- this.warmupDelayTicks = i; +- this.setOwner(livingentity); ++ this.warmupDelayTicks = z; ++ this.setOwner(entityliving); + this.setYRot(f * 57.295776F); +- this.setPos(d0, d1, d2); ++ this.setPos(x, d1, y); + } + + @Override +- @Override + protected void defineSynchedData() {} + +- public void setOwner(@Nullable LivingEntity livingentity) { +- this.owner = livingentity; +- this.ownerUUID = livingentity == null ? null : livingentity.getUUID(); ++ public void setOwner(@Nullable LivingEntity owner) { ++ this.owner = owner; ++ this.ownerUUID = owner == null ? null : owner.getUUID(); + } + + @Nullable + @Override +- @Override + public LivingEntity getOwner() { + if (this.owner == null && this.ownerUUID != null && this.level() instanceof ServerLevel) { + Entity entity = ((ServerLevel) this.level()).getEntity(this.ownerUUID); +@@ -66,27 +64,24 @@ + } + + @Override +- @Override +- protected void readAdditionalSaveData(CompoundTag compoundtag) { +- this.warmupDelayTicks = compoundtag.getInt("Warmup"); +- if (compoundtag.hasUUID("Owner")) { +- this.ownerUUID = compoundtag.getUUID("Owner"); ++ protected void readAdditionalSaveData(CompoundTag compound) { ++ this.warmupDelayTicks = compound.getInt("Warmup"); ++ if (compound.hasUUID("Owner")) { ++ this.ownerUUID = compound.getUUID("Owner"); + } + + } + + @Override +- @Override +- protected void addAdditionalSaveData(CompoundTag compoundtag) { +- compoundtag.putInt("Warmup", this.warmupDelayTicks); ++ protected void addAdditionalSaveData(CompoundTag compound) { ++ compound.putInt("Warmup", this.warmupDelayTicks); + if (this.ownerUUID != null) { +- compoundtag.putUUID("Owner", this.ownerUUID); ++ compound.putUUID("Owner", this.ownerUUID); + } + + } + + @Override +- @Override + public void tick() { + super.tick(); + if (this.level().isClientSide) { +@@ -111,9 +106,9 @@ + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { +- LivingEntity livingentity = (LivingEntity) iterator.next(); ++ LivingEntity entityliving = (LivingEntity) iterator.next(); + +- this.dealDamageTo(livingentity); ++ this.dealDamageTo(entityliving); + } + } + +@@ -129,28 +124,29 @@ + + } + +- private void dealDamageTo(LivingEntity livingentity) { +- LivingEntity livingentity1 = this.getOwner(); ++ private void dealDamageTo(LivingEntity target) { ++ LivingEntity entityliving1 = this.getOwner(); + +- if (livingentity.isAlive() && !livingentity.isInvulnerable() && livingentity != livingentity1) { +- if (livingentity1 == null) { +- livingentity.hurt(this.damageSources().magic(), 6.0F); ++ if (target.isAlive() && !target.isInvulnerable() && target != entityliving1) { ++ if (entityliving1 == null) { ++ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = this; // CraftBukkit ++ target.hurt(this.damageSources().magic(), 6.0F); ++ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = null; // CraftBukkit + } else { +- if (livingentity1.isAlliedTo((Entity) livingentity)) { ++ if (entityliving1.isAlliedTo((Entity) target)) { + return; + } + +- livingentity.hurt(this.damageSources().indirectMagic(this, livingentity1), 6.0F); ++ target.hurt(this.damageSources().indirectMagic(this, entityliving1), 6.0F); + } + + } + } + + @Override +- @Override +- public void handleEntityEvent(byte b0) { +- super.handleEntityEvent(b0); +- if (b0 == 4) { ++ public void handleEntityEvent(byte id) { ++ super.handleEntityEvent(id); ++ if (id == 4) { + this.clientSideAttackStarted = true; + if (!this.isSilent()) { + this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.EVOKER_FANGS_ATTACK, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.2F + 0.85F, false); +@@ -159,13 +155,13 @@ + + } + +- public float getAnimationProgress(float f) { ++ public float getAnimationProgress(float partialTicks) { + if (!this.clientSideAttackStarted) { + return 0.0F; + } else { + int i = this.lifeTicks - 2; + +- return i <= 0 ? 1.0F : 1.0F - ((float) i - f) / 20.0F; ++ return i <= 0 ? 1.0F : 1.0F - ((float) i - partialTicks) / 20.0F; + } + } + } |