Paper/nms-patches/EntityShulkerBullet.patch
2019-12-11 09:00:00 +11:00

50 lines
1.8 KiB
Diff

--- a/net/minecraft/server/EntityShulkerBullet.java
+++ b/net/minecraft/server/EntityShulkerBullet.java
@@ -40,8 +40,29 @@
this.target = entity;
this.dir = EnumDirection.UP;
this.a(enumdirection_enumaxis);
+ projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
}
+ // CraftBukkit start
+ public EntityLiving getShooter() {
+ return this.shooter;
+ }
+
+ public void setShooter(EntityLiving e) {
+ this.shooter = e;
+ }
+
+ public Entity getTarget() {
+ return this.target;
+ }
+
+ public void setTarget(Entity e) {
+ this.target = e;
+ this.dir = EnumDirection.UP;
+ this.a(EnumDirection.EnumAxis.X);
+ }
+ // CraftBukkit end
+
@Override
public SoundCategory getSoundCategory() {
return SoundCategory.HOSTILE;
@@ -298,6 +319,7 @@
}
protected void a(MovingObjectPosition movingobjectposition) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
Entity entity = ((MovingObjectPositionEntity) movingobjectposition).getEntity();
boolean flag = entity.damageEntity(DamageSource.a(this, this.shooter).c(), 4.0F);
@@ -305,7 +327,7 @@
if (flag) {
this.a(this.shooter, entity);
if (entity instanceof EntityLiving) {
- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.LEVITATION, 200));
+ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.LEVITATION, 200), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
}
}
} else {