2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
|
2023-09-21 18:57:13 +02:00
|
|
|
@@ -60,7 +60,20 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
this.finalTarget = entity;
|
|
|
|
this.currentMoveDirection = EnumDirection.UP;
|
2021-11-21 23:00:00 +01:00
|
|
|
this.selectNextMoveDirection(enumdirection_enumaxis);
|
2016-02-29 22:32:46 +01:00
|
|
|
+ projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
2023-09-21 18:57:13 +02:00
|
|
|
+ }
|
|
|
|
+
|
2016-03-06 04:56:09 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ public Entity getTarget() {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ return this.finalTarget;
|
2016-03-06 04:56:09 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setTarget(Entity e) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ this.finalTarget = e;
|
|
|
|
+ this.currentMoveDirection = EnumDirection.UP;
|
2021-11-21 23:00:00 +01:00
|
|
|
+ this.selectNextMoveDirection(EnumDirection.EnumAxis.X);
|
2023-09-21 18:57:13 +02:00
|
|
|
}
|
2016-03-06 04:56:09 +01:00
|
|
|
+ // CraftBukkit end
|
2023-09-21 18:57:13 +02:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public SoundCategory getSoundSource() {
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -225,7 +238,7 @@
|
2023-06-07 17:30:00 +02:00
|
|
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
2021-05-09 08:51:44 +02:00
|
|
|
|
|
|
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
2021-11-21 23:00:00 +01:00
|
|
|
- this.onHit(movingobjectposition);
|
2021-05-09 08:51:44 +02:00
|
|
|
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -294,7 +307,7 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
if (entity instanceof EntityLiving) {
|
2023-03-14 17:30:00 +01:00
|
|
|
EntityLiving entityliving1 = (EntityLiving) entity;
|
|
|
|
|
|
|
|
- entityliving1.addEffect(new MobEffect(MobEffects.LEVITATION, 200), (Entity) MoreObjects.firstNonNull(entity1, this));
|
|
|
|
+ entityliving1.addEffect(new MobEffect(MobEffects.LEVITATION, 200), (Entity) MoreObjects.firstNonNull(entity1, this), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|
|
|
|
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -325,6 +338,11 @@
|
2020-09-06 10:13:21 +02:00
|
|
|
|
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public boolean hurt(DamageSource damagesource, float f) {
|
2020-09-06 10:13:21 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2023-06-07 17:30:00 +02:00
|
|
|
if (!this.level().isClientSide) {
|
2021-06-11 07:00:00 +02:00
|
|
|
this.playSound(SoundEffects.SHULKER_BULLET_HURT, 1.0F, 1.0F);
|
2023-06-07 17:30:00 +02:00
|
|
|
((WorldServer) this.level()).sendParticles(Particles.CRIT, this.getX(), this.getY(), this.getZ(), 15, 0.2D, 0.2D, 0.2D, 0.0D);
|