aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch192
1 files changed, 192 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch
new file mode 100644
index 0000000000..904fa91739
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/EvokerFangs.java.patch
@@ -0,0 +1,192 @@
+--- a/net/minecraft/world/entity/projectile/EvokerFangs.java
++++ b/net/minecraft/world/entity/projectile/EvokerFangs.java
+@@ -1,5 +1,7 @@
+ package net.minecraft.world.entity.projectile;
+
++import java.util.Iterator;
++import java.util.List;
+ import java.util.UUID;
+ import javax.annotation.Nullable;
+ import net.minecraft.core.particles.ParticleTypes;
+@@ -13,12 +15,13 @@
+ import net.minecraft.world.level.Level;
+
+ public class EvokerFangs extends Entity implements TraceableEntity {
++
+ 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 = 22;
++ private int lifeTicks;
+ private boolean clientSideAttackStarted;
+ @Nullable
+ private LivingEntity owner;
+@@ -27,19 +30,19 @@
+
+ public EvokerFangs(EntityType<? extends EvokerFangs> entityType, Level level) {
+ super(entityType, level);
++ this.lifeTicks = 22;
+ }
+
+- public EvokerFangs(Level level, double x, double y, double z, float yRot, int warmupDelay, LivingEntity owner) {
++ public EvokerFangs(Level level, double x, double d1, double y, float f, int z, LivingEntity entityliving) {
+ this(EntityType.EVOKER_FANGS, level);
+- this.warmupDelayTicks = warmupDelay;
+- this.setOwner(owner);
+- this.setYRot(yRot * (180.0F / (float)Math.PI));
+- this.setPos(x, y, z);
++ this.warmupDelayTicks = z;
++ this.setOwner(entityliving);
++ this.setYRot(f * 57.295776F);
++ this.setPos(x, d1, y);
+ }
+
+ @Override
+- protected void defineSynchedData() {
+- }
++ protected void defineSynchedData() {}
+
+ public void setOwner(@Nullable LivingEntity owner) {
+ this.owner = owner;
+@@ -50,9 +53,10 @@
+ @Override
+ public LivingEntity getOwner() {
+ if (this.owner == null && this.ownerUUID != null && this.level() instanceof ServerLevel) {
+- Entity entity = ((ServerLevel)this.level()).getEntity(this.ownerUUID);
++ Entity entity = ((ServerLevel) this.level()).getEntity(this.ownerUUID);
++
+ if (entity instanceof LivingEntity) {
+- this.owner = (LivingEntity)entity;
++ this.owner = (LivingEntity) entity;
+ }
+ }
+
+@@ -65,6 +69,7 @@
+ if (compound.hasUUID("Owner")) {
+ this.ownerUUID = compound.getUUID("Owner");
+ }
++
+ }
+
+ @Override
+@@ -73,6 +78,7 @@
+ if (this.ownerUUID != null) {
+ compound.putUUID("Owner", this.ownerUUID);
+ }
++
+ }
+
+ @Override
+@@ -80,28 +86,34 @@
+ super.tick();
+ if (this.level().isClientSide) {
+ if (this.clientSideAttackStarted) {
+- this.lifeTicks--;
++ --this.lifeTicks;
+ if (this.lifeTicks == 14) {
+- for (int i = 0; i < 12; i++) {
+- double d = this.getX() + (this.random.nextDouble() * 2.0 - 1.0) * (double)this.getBbWidth() * 0.5;
+- double d1 = this.getY() + 0.05 + this.random.nextDouble();
+- double d2 = this.getZ() + (this.random.nextDouble() * 2.0 - 1.0) * (double)this.getBbWidth() * 0.5;
+- double d3 = (this.random.nextDouble() * 2.0 - 1.0) * 0.3;
+- double d4 = 0.3 + this.random.nextDouble() * 0.3;
+- double d5 = (this.random.nextDouble() * 2.0 - 1.0) * 0.3;
+- this.level().addParticle(ParticleTypes.CRIT, d, d1 + 1.0, d2, d3, d4, d5);
++ for (int i = 0; i < 12; ++i) {
++ double d0 = this.getX() + (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.getBbWidth() * 0.5D;
++ double d1 = this.getY() + 0.05D + this.random.nextDouble();
++ double d2 = this.getZ() + (this.random.nextDouble() * 2.0D - 1.0D) * (double) this.getBbWidth() * 0.5D;
++ double d3 = (this.random.nextDouble() * 2.0D - 1.0D) * 0.3D;
++ double d4 = 0.3D + this.random.nextDouble() * 0.3D;
++ double d5 = (this.random.nextDouble() * 2.0D - 1.0D) * 0.3D;
++
++ this.level().addParticle(ParticleTypes.CRIT, d0, d1 + 1.0D, d2, d3, d4, d5);
+ }
+ }
+ }
+ } else if (--this.warmupDelayTicks < 0) {
+ if (this.warmupDelayTicks == -8) {
+- for (LivingEntity livingEntity : this.level().getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(0.2, 0.0, 0.2))) {
+- this.dealDamageTo(livingEntity);
++ List<LivingEntity> list = this.level().getEntitiesOfClass(LivingEntity.class, this.getBoundingBox().inflate(0.2D, 0.0D, 0.2D));
++ Iterator iterator = list.iterator();
++
++ while (iterator.hasNext()) {
++ LivingEntity entityliving = (LivingEntity) iterator.next();
++
++ this.dealDamageTo(entityliving);
+ }
+ }
+
+ if (!this.sentSpikeEvent) {
+- this.level().broadcastEntityEvent(this, (byte)4);
++ this.level().broadcastEntityEvent(this, (byte) 4);
+ this.sentSpikeEvent = true;
+ }
+
+@@ -109,20 +121,25 @@
+ this.discard();
+ }
+ }
++
+ }
+
+ private void dealDamageTo(LivingEntity target) {
+- LivingEntity owner = this.getOwner();
+- if (target.isAlive() && !target.isInvulnerable() && target != owner) {
+- if (owner == null) {
++ LivingEntity entityliving1 = this.getOwner();
++
++ 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 (owner.isAlliedTo(target)) {
++ if (entityliving1.isAlliedTo((Entity) target)) {
+ return;
+ }
+
+- target.hurt(this.damageSources().indirectMagic(this, owner), 6.0F);
++ target.hurt(this.damageSources().indirectMagic(this, entityliving1), 6.0F);
+ }
++
+ }
+ }
+
+@@ -132,19 +149,10 @@
+ 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
+- );
++ 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);
+ }
+ }
++
+ }
+
+ public float getAnimationProgress(float partialTicks) {
+@@ -152,7 +160,8 @@
+ return 0.0F;
+ } else {
+ int i = this.lifeTicks - 2;
+- return i <= 0 ? 1.0F : 1.0F - ((float)i - partialTicks) / 20.0F;
++
++ return i <= 0 ? 1.0F : 1.0F - ((float) i - partialTicks) / 20.0F;
+ }
+ }
+ }