mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 07:49:03 +00:00
Started api and events
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.dre.brewery;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import com.dre.brewery.api.events.brew.BrewModifyEvent;
|
||||
import com.dre.brewery.lore.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -458,6 +459,9 @@ public class Brew {
|
||||
// distill custom potion in given slot
|
||||
public void distillSlot(ItemStack slotItem, PotionMeta potionMeta) {
|
||||
if (immutable) return;
|
||||
BrewModifyEvent modifyEvent = new BrewModifyEvent(this, BrewModifyEvent.Type.DISTILL);
|
||||
P.p.getServer().getPluginManager().callEvent(modifyEvent);
|
||||
if (modifyEvent.isCancelled()) return;
|
||||
|
||||
distillRuns += 1;
|
||||
BrewLore lore = new BrewLore(this, potionMeta);
|
||||
@@ -512,6 +516,9 @@ public class Brew {
|
||||
|
||||
public void age(ItemStack item, float time, byte woodType) {
|
||||
if (immutable) return;
|
||||
BrewModifyEvent modifyEvent = new BrewModifyEvent(this, BrewModifyEvent.Type.AGE);
|
||||
P.p.getServer().getPluginManager().callEvent(modifyEvent);
|
||||
if (modifyEvent.isCancelled()) return;
|
||||
|
||||
PotionMeta potionMeta = (PotionMeta) item.getItemMeta();
|
||||
BrewLore lore = new BrewLore(this, potionMeta);
|
||||
|
||||
Reference in New Issue
Block a user