3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

SPIGOT-3433: Improve AreaEffectCloud#getSource

Dieser Commit ist enthalten in:
md_5 2017-07-22 09:51:22 +10:00
Ursprung 9a82fa7785
Commit 5a12442f22
3 geänderte Dateien mit 12 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -72,3 +72,11 @@
}
}
@@ -202,6 +225,7 @@
if (!collection.isEmpty()) {
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ);
+ entityareaeffectcloud.setSource(this); // CraftBukkit
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);

Datei anzeigen

@ -91,15 +91,7 @@
}
}
}
@@ -167,6 +199,7 @@
private void a(ItemStack itemstack, PotionRegistry potionregistry) {
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX, this.locY, this.locZ);
+ entityareaeffectcloud.projectileSource = this.projectileSource; // CraftBukkit
entityareaeffectcloud.setSource(this.getShooter());
entityareaeffectcloud.setRadius(3.0F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
@@ -187,7 +220,14 @@
@@ -187,7 +219,14 @@
entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
}

Datei anzeigen

@ -14,6 +14,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.entity.AreaEffectCloud;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
@ -206,7 +207,8 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
}
public ProjectileSource getSource() {
return getHandle().projectileSource;
EntityLiving source = getHandle().y(); // PAIL: rename
return (source == null) ? null : (LivingEntity) source.getBukkitEntity();
}
public void setSource(ProjectileSource shooter) {
@ -215,6 +217,5 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
} else {
getHandle().setSource((EntityLiving) null);
}
getHandle().projectileSource = shooter;
}
}