mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-11 07:05:00 +00:00
adjust origins to listen to config
This commit is contained in:
@@ -88,6 +88,19 @@ public class ItemLore {
|
||||
return itemLore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a given lore from an item.
|
||||
*
|
||||
* @param inputLore The item's lore.
|
||||
* @param toRemove The line to remove.
|
||||
* @return The lore with the line removed.
|
||||
*/
|
||||
public List<Component> removeLore(List<Component> inputLore, Component toRemove) {
|
||||
List<Component> newLore = new ArrayList<>(inputLore);
|
||||
newLore.removeIf(line -> PlainTextComponentSerializer.plainText().serialize(line).equals(PlainTextComponentSerializer.plainText().serialize(toRemove)));
|
||||
return newLore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds new ownership to an item.
|
||||
*
|
||||
@@ -977,17 +990,4 @@ public class ItemLore {
|
||||
meta.lore(newLore);
|
||||
return meta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a given lore from an item.
|
||||
*
|
||||
* @param inputLore The item's lore.
|
||||
* @param toRemove The line to remove.
|
||||
* @return The lore with the line removed.
|
||||
*/
|
||||
public List<Component> removeLore(List<Component> inputLore, Component toRemove) {
|
||||
List<Component> newLore = new ArrayList<>(inputLore);
|
||||
newLore.removeIf(line -> PlainTextComponentSerializer.plainText().serialize(line).equals(PlainTextComponentSerializer.plainText().serialize(toRemove)));
|
||||
return newLore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ConfigTools {
|
||||
*
|
||||
* @param material The item type to check.
|
||||
* @param configName The config we are checking under.
|
||||
* @return If we want to allow lore or not.
|
||||
* @return If we want to add data or not.
|
||||
*/
|
||||
public boolean checkConfig(Material material, String configName) {
|
||||
String itemName = material.toString().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user