mirror of
https://github.com/AXOLOTsh/PluginUtils.git
synced 2026-09-21 03:46:23 +03:00
feat: add Collection overload for ComponentUtils::component
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.axolotsh.pluginutils;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -41,6 +43,10 @@ public class ComponentUtils {
|
||||
return mm.deserialize(miniMessage, tags);
|
||||
}
|
||||
|
||||
public static Component component(String miniMessage, Collection<TagResolver> tags) {
|
||||
return mm.deserialize(miniMessage, tags.toArray(TagResolver[]::new));
|
||||
}
|
||||
|
||||
public static Component component(ItemStack item) {
|
||||
return item.displayName().hoverEvent(item.asHoverEvent());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user