Files
Rekkit/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
2012-03-01 01:12:41 +00:00

43 lines
1.1 KiB
Java

package org.bukkit.craftbukkit.entity;
import java.util.Collection;
import net.minecraft.server.EntityPotion;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.potion.Potion;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionEffect;
public class CraftThrownPotion extends CraftProjectile implements ThrownPotion {
private Collection<PotionEffect> effects = null;
public CraftThrownPotion(CraftServer server, EntityPotion entity) {
super(server, entity);
}
public Collection<PotionEffect> getEffects() {
if (effects == null) {
effects = Potion.getBrewer().getEffectsFromDamage(getHandle().getPotionValue());
}
return effects;
}
@Override
public EntityPotion getHandle() {
return (EntityPotion) entity;
}
@Override
public String toString() {
return "CraftThrownPotion";
}
public EntityType getType() {
return EntityType.SPLASH_POTION;
}
}