SPIGOT-1904: AreaEffectCloud events and additional API
By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.server.EntityAreaEffectCloud;
|
||||
import net.minecraft.server.EntityLiving;
|
||||
import net.minecraft.server.MobEffect;
|
||||
import net.minecraft.server.MobEffectList;
|
||||
|
||||
@@ -15,6 +16,7 @@ import org.bukkit.entity.AreaEffectCloud;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.projectiles.ProjectileSource;
|
||||
import org.bukkit.potion.PotionData;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -202,4 +204,17 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
|
||||
public PotionData getBasePotionData() {
|
||||
return CraftPotionUtil.toBukkit(getHandle().getType());
|
||||
}
|
||||
|
||||
public ProjectileSource getSource() {
|
||||
return getHandle().projectileSource;
|
||||
}
|
||||
|
||||
public void setSource(ProjectileSource shooter) {
|
||||
if (shooter instanceof CraftLivingEntity) {
|
||||
getHandle().a((EntityLiving) ((CraftLivingEntity) shooter).getHandle()); // PAIL rename setSource
|
||||
} else {
|
||||
getHandle().a((EntityLiving) null);
|
||||
}
|
||||
getHandle().projectileSource = shooter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LingeringPotion;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CraftLingeringPotion extends CraftThrownPotion {
|
||||
public class CraftLingeringPotion extends CraftThrownPotion implements LingeringPotion {
|
||||
|
||||
public CraftLingeringPotion(CraftServer server, EntityPotion entity) {
|
||||
super(server, entity);
|
||||
|
||||
@@ -6,9 +6,10 @@ import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.SplashPotion;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class CraftSplashPotion extends CraftThrownPotion {
|
||||
public class CraftSplashPotion extends CraftThrownPotion implements SplashPotion {
|
||||
|
||||
public CraftSplashPotion(CraftServer server, EntityPotion entity) {
|
||||
super(server, entity);
|
||||
|
||||
Reference in New Issue
Block a user