diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/GenerateLoreEvent.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/GenerateLoreEvent.java index 9a01670e..ed8a3204 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/GenerateLoreEvent.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/GenerateLoreEvent.java @@ -7,66 +7,71 @@ import org.bukkit.event.HandlerList; import java.util.List; +/** + * @deprecated Will be removed in the future. SCRIPTS must replace these + * because there are no events which can support both sync and async + */ +@Deprecated public class GenerateLoreEvent extends Event { - private static final HandlerList handlers = new HandlerList(); + private static final HandlerList handlers = new HandlerList(); - private final MMOItem item; - private final List lore, parsed; - private final LoreBuilder builder; + private final MMOItem item; + private final List lore, parsed; + private final LoreBuilder builder; - public GenerateLoreEvent(MMOItem item, LoreBuilder builder, List lore, List parsed) { - this.item = item; - this.lore = lore; - this.parsed = parsed; - this.builder = builder; - } + public GenerateLoreEvent(MMOItem item, LoreBuilder builder, List lore, List parsed) { + this.item = item; + this.lore = lore; + this.parsed = parsed; + this.builder = builder; + } - /** - * @return The MMOItem the lore is being generated for - */ - public MMOItem getItem() { - return item; - } + /** + * @return The MMOItem the lore is being generated for + */ + public MMOItem getItem() { + return item; + } - /** - * @return The LoreBuilder used to build this lore. - */ - public LoreBuilder getBuilder() { - return builder; - } + /** + * @return The LoreBuilder used to build this lore. + */ + public LoreBuilder getBuilder() { + return builder; + } - /** - * @return The list of pre-placeholder lore (before any placeholders have been parsed) - */ - public List getLore() { - return lore; - } + /** + * @return The list of pre-placeholder lore (before any placeholders have been parsed) + */ + public List getLore() { + return lore; + } - /** - * @return The list of parsed lore (after all placeholders have been parsed) - */ - public List getParsedLore() { - return parsed; - } + /** + * @return The list of parsed lore (after all placeholders have been parsed) + */ + public List getParsedLore() { + return parsed; + } - /** - * Sets the final lore of the item. - *

- * This sets the parsed lore, so any future calls of - * getParsedLore() will return the new list. - * - * @param lore The new lore of the item - */ - public void setFinalLore(List lore) { - this.parsed.clear(); - this.parsed.addAll(lore); - } + /** + * Sets the final lore of the item. + *

+ * This sets the parsed lore, so any future calls of + * getParsedLore() will return the new list. + * + * @param lore The new lore of the item + */ + public void setFinalLore(List lore) { + this.parsed.clear(); + this.parsed.addAll(lore); + } - public HandlerList getHandlers() { - return handlers; - } + public HandlerList getHandlers() { + return handlers; + } - public static HandlerList getHandlerList() { - return handlers; - } + public static HandlerList getHandlerList() { + return handlers; + } } \ No newline at end of file diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/ItemBuildEvent.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/ItemBuildEvent.java index adbf8626..8a89402a 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/ItemBuildEvent.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/event/ItemBuildEvent.java @@ -4,6 +4,11 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.bukkit.inventory.ItemStack; +/** + * @deprecated Will be removed in the future. SCRIPTS must replace these + * because there are no events which can support both sync and async + */ +@Deprecated public class ItemBuildEvent extends Event { private static final HandlerList handlers = new HandlerList(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java index a109703a..8bb8c1a0 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/CraftingStationView.java @@ -116,7 +116,8 @@ public class CraftingStationView extends PluginInventory { inv.setItem(layout.getQueueSlots().get(j - queueOffset), ConfigItems.QUEUE_ITEM_DISPLAY.newBuilder(queue.getCrafts().get(j), j + 1).build()); } - }.runTaskTimerAsynchronously(MMOItems.plugin, 0, 20); + }.runTaskTimer(MMOItems.plugin, 0, 20); + if (station.getItemOptions().hasFill()) for (int j = 0; j < layout.getSize(); j++) if (inv.getItem(j) == null || inv.getItem(j).getType() == Material.AIR)