Removed useless async task

This commit is contained in:
Jules 2023-03-09 18:45:43 +01:00
parent 73e4f60482
commit 5f1e32d581
3 changed files with 64 additions and 53 deletions

View File

@ -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<String> lore, parsed;
private final LoreBuilder builder;
private final MMOItem item;
private final List<String> lore, parsed;
private final LoreBuilder builder;
public GenerateLoreEvent(MMOItem item, LoreBuilder builder, List<String> lore, List<String> parsed) {
this.item = item;
this.lore = lore;
this.parsed = parsed;
this.builder = builder;
}
public GenerateLoreEvent(MMOItem item, LoreBuilder builder, List<String> lore, List<String> 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<String> getLore() {
return lore;
}
/**
* @return The list of pre-placeholder lore (before any placeholders have been parsed)
*/
public List<String> getLore() {
return lore;
}
/**
* @return The list of parsed lore (after all placeholders have been parsed)
*/
public List<String> getParsedLore() {
return parsed;
}
/**
* @return The list of parsed lore (after all placeholders have been parsed)
*/
public List<String> getParsedLore() {
return parsed;
}
/**
* Sets the final lore of the item.
* <p>
* 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<String> lore) {
this.parsed.clear();
this.parsed.addAll(lore);
}
/**
* Sets the final lore of the item.
* <p>
* 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<String> 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;
}
}

View File

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

View File

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