cn.nukkit.potion.Potion Java Examples

The following examples show how to use cn.nukkit.potion.Potion. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ItemPotion.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean onUse(Player player, int ticksUsed) {
    PlayerItemConsumeEvent consumeEvent = new PlayerItemConsumeEvent(player, this);
    player.getServer().getPluginManager().callEvent(consumeEvent);
    if (consumeEvent.isCancelled()) {
        return false;
    }
    Potion potion = Potion.getPotion(this.getDamage()).setSplash(false);

    if (player.getGamemode() == SURVIVAL) {
        --this.count;
        player.getInventory().setItemInHand(this);
        player.getInventory().addItem(new ItemGlassBottle());
    }

    if (potion != null) {
        potion.applyPotion(player);
    }
    return true;
}
 
Example #2
Source File: PotionCollideEvent.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public PotionCollideEvent(Potion potion, EntityPotion entityPotion) {
    super(potion);
    this.thrownPotion = entityPotion;
}
 
Example #3
Source File: PotionApplyEvent.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public PotionApplyEvent(Potion potion, Entity entity) {
    super(potion);
    this.entity = entity;
}
 
Example #4
Source File: PotionEvent.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public PotionEvent(Potion potion) {
    this.potion = potion;
}
 
Example #5
Source File: PotionEvent.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public Potion getPotion() {
    return potion;
}
 
Example #6
Source File: PotionEvent.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public void setPotion(Potion potion) {
    this.potion = potion;
}
 
Example #7
Source File: PotionCollideEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionCollideEvent(Potion potion, EntityPotion thrownPotion) {
    super(potion);
    this.thrownPotion = thrownPotion;
}
 
Example #8
Source File: PotionApplyEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionApplyEvent(Potion potion, Effect applyEffect, Entity entity) {
    super(potion);
    this.applyEffect = applyEffect;
    this.entity = entity;
}
 
Example #9
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionEvent(Potion potion) {
    this.potion = potion;
}
 
Example #10
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public Potion getPotion() {
    return potion;
}
 
Example #11
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public void setPotion(Potion potion) {
    this.potion = potion;
}
 
Example #12
Source File: PotionCollideEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionCollideEvent(Potion potion, EntityPotion thrownPotion) {
    super(potion);
    this.thrownPotion = thrownPotion;
}
 
Example #13
Source File: PotionApplyEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionApplyEvent(Potion potion, Effect applyEffect, Entity entity) {
    super(potion);
    this.applyEffect = applyEffect;
    this.entity = entity;
}
 
Example #14
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public PotionEvent(Potion potion) {
    this.potion = potion;
}
 
Example #15
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public Potion getPotion() {
    return potion;
}
 
Example #16
Source File: PotionEvent.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public void setPotion(Potion potion) {
    this.potion = potion;
}