mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityShulkerBullet.java
|
|
@@ -5,6 +5,7 @@
|
|
import java.util.UUID;
|
|
import javax.annotation.Nullable;
|
|
import net.minecraft.entity.Entity;
|
|
+import net.minecraft.entity.EntityLiving;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.init.MobEffects;
|
|
@@ -77,8 +78,29 @@
|
|
this.target = targetIn;
|
|
this.direction = EnumFacing.UP;
|
|
this.selectNextMoveDirection(p_i46772_4_);
|
|
+ projectileSource = (org.bukkit.entity.LivingEntity) ownerIn.getBukkitEntity();
|
|
}
|
|
|
|
+ // CraftBukkit start
|
|
+ public EntityLivingBase getShooter() {
|
|
+ return this.owner;
|
|
+ }
|
|
+
|
|
+ public void setShooter(EntityLivingBase e) {
|
|
+ this.owner = e;
|
|
+ }
|
|
+
|
|
+ public Entity getTarget() {
|
|
+ return this.target;
|
|
+ }
|
|
+
|
|
+ public void setTarget(Entity e) {
|
|
+ this.target = e;
|
|
+ this.direction = EnumFacing.UP;
|
|
+ this.selectNextMoveDirection(EnumFacing.Axis.X);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
protected void writeEntityToNBT(NBTTagCompound compound)
|
|
{
|
|
if (this.owner != null)
|
|
@@ -310,7 +332,7 @@
|
|
|
|
RayTraceResult raytraceresult = ProjectileHelper.forwardsRaycast(this, true, false, this.owner);
|
|
|
|
- if (raytraceresult != null)
|
|
+ if (raytraceresult != null && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult))
|
|
{
|
|
this.bulletHit(raytraceresult);
|
|
}
|
|
@@ -382,6 +404,7 @@
|
|
|
|
protected void bulletHit(RayTraceResult result)
|
|
{
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, result);
|
|
if (result.entityHit == null)
|
|
{
|
|
((WorldServer)this.world).spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 2, 0.2D, 0.2D, 0.2D, 0.0D);
|