aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch
new file mode 100644
index 0000000000..5c3c112607
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ShulkerBullet.java.patch
@@ -0,0 +1,65 @@
+--- a/net/minecraft/world/entity/projectile/ShulkerBullet.java
++++ b/net/minecraft/world/entity/projectile/ShulkerBullet.java
+@@ -58,8 +60,21 @@
+ this.finalTarget = finalTarget;
+ this.currentMoveDirection = Direction.UP;
+ this.selectNextMoveDirection(axis);
++ projectileSource = (org.bukkit.entity.LivingEntity) shooter.getBukkitEntity(); // CraftBukkit
+ }
+
++ // CraftBukkit start
++ public Entity getTarget() {
++ return this.finalTarget;
++ }
++
++ public void setTarget(Entity e) {
++ this.finalTarget = e;
++ this.currentMoveDirection = Direction.UP;
++ this.selectNextMoveDirection(Direction.Axis.X);
++ }
++ // CraftBukkit end
++
+ @Override
+ public SoundSource getSoundSource() {
+ return SoundSource.HOSTILE;
+@@ -219,9 +235,10 @@
+ );
+ }
+
+- HitResult hitResultOnMoveVector = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
+- if (hitResultOnMoveVector.getType() != HitResult.Type.MISS) {
+- this.onHit(hitResultOnMoveVector);
++ HitResult movingobjectposition = ProjectileUtil.getHitResultOnMoveVector(this, this::canHitEntity);
++
++ if (movingobjectposition.getType() != HitResult.EnumMovingObjectType.MISS) {
++ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
+ }
+ }
+
+@@ -287,9 +303,11 @@
+ LivingEntity livingEntity = owner instanceof LivingEntity ? (LivingEntity)owner : null;
+ boolean flag = entity.hurt(this.damageSources().mobProjectile(this, livingEntity), 4.0F);
+ if (flag) {
+- this.doEnchantDamageEffects(livingEntity, entity);
+- if (entity instanceof LivingEntity livingEntity1) {
+- livingEntity1.addEffect(new MobEffectInstance(MobEffects.LEVITATION, 200), MoreObjects.firstNonNull(owner, this));
++ this.doEnchantDamageEffects(entityliving, entity);
++ if (entity instanceof LivingEntity) {
++ LivingEntity entityliving1 = (LivingEntity) entity;
++
++ entityliving1.addEffect(new MobEffectInstance(MobEffects.LEVITATION, 200), (Entity) MoreObjects.firstNonNull(entity1, this), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
+ }
+ }
+ }
+@@ -319,6 +338,11 @@
+
+ @Override
+ public boolean hurt(DamageSource source, float amount) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, source, amount, false)) {
++ return false;
++ }
++ // CraftBukkit end
+ if (!this.level().isClientSide) {
+ this.playSound(SoundEvents.SHULKER_BULLET_HURT, 1.0F, 1.0F);
+ ((ServerLevel)this.level()).sendParticles(ParticleTypes.CRIT, this.getX(), this.getY(), this.getZ(), 15, 0.2, 0.2, 0.2, 0.0);