[Bleeding] Added Potions API. Fixes BUKKIT-389

This commit is contained in:
fullwall
2012-01-09 15:51:32 +08:00
committed by EvilSeph
parent 63b9ed9ab4
commit f52665348e
8 changed files with 227 additions and 3 deletions

View File

@@ -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;