Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
SPIGOT-3433: Improve AreaEffectCloud#getSource
Dieser Commit ist enthalten in:
Ursprung
9a82fa7785
Commit
5a12442f22
@ -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);
|
||||||
|
@ -91,15 +91,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,6 +199,7 @@
|
@@ -187,7 +219,14 @@
|
||||||
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 @@
|
|
||||||
entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
|
entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.craftbukkit.CraftServer;
|
|||||||
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
|
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
|
||||||
import org.bukkit.entity.AreaEffectCloud;
|
import org.bukkit.entity.AreaEffectCloud;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
@ -206,7 +207,8 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ProjectileSource getSource() {
|
public ProjectileSource getSource() {
|
||||||
return getHandle().projectileSource;
|
EntityLiving source = getHandle().y(); // PAIL: rename
|
||||||
|
return (source == null) ? null : (LivingEntity) source.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSource(ProjectileSource shooter) {
|
public void setSource(ProjectileSource shooter) {
|
||||||
@ -215,6 +217,5 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
|||||||
} else {
|
} else {
|
||||||
getHandle().setSource((EntityLiving) null);
|
getHandle().setSource((EntityLiving) null);
|
||||||
}
|
}
|
||||||
getHandle().projectileSource = shooter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren