Started api and events

This commit is contained in:
Sn0wStorm
2019-10-11 20:44:43 +02:00
parent 49fb0e3d82
commit 519c4821d9
32 changed files with 1400 additions and 264 deletions
+7
View File
@@ -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);