[Bleeding] Added Potions API. Fixes BUKKIT-389
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.server.EntityPotion;
|
||||
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
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().f());
|
||||
}
|
||||
|
||||
return effects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPotion getHandle() {
|
||||
return (EntityPotion) entity;
|
||||
|
||||
Reference in New Issue
Block a user