mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
rename many config things
This commit is contained in:
@@ -117,7 +117,7 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
*/
|
*/
|
||||||
public final NamespacedKey originType = new NamespacedKey(this, "origin");
|
public final NamespacedKey originType = new NamespacedKey(this, "origin");
|
||||||
|
|
||||||
public final int CONFIG_VERSION = 11;
|
public final int CONFIG_VERSION = 12;
|
||||||
public final Logger logger = this.getLogger();
|
public final Logger logger = this.getLogger();
|
||||||
public final File configFile = new File(this.getDataFolder(), "config.yml");
|
public final File configFile = new File(this.getDataFolder(), "config.yml");
|
||||||
public boolean tokens = false;
|
public boolean tokens = false;
|
||||||
|
|||||||
@@ -266,7 +266,6 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
player.getInventory().setItem(slot, finalItem);
|
player.getInventory().setItem(slot, finalItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toolStats.configTools.checkConfig(original.getType(), "created-by")) {
|
|
||||||
if (container.has(toolStats.itemOwner, new UUIDDataType())) {
|
if (container.has(toolStats.itemOwner, new UUIDDataType())) {
|
||||||
UUID owner = container.get(toolStats.itemOwner, new UUIDDataType());
|
UUID owner = container.get(toolStats.itemOwner, new UUIDDataType());
|
||||||
String ownerName = null;
|
String ownerName = null;
|
||||||
@@ -287,33 +286,37 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
// show how the item was created based on the previous lore
|
// show how the item was created based on the previous lore
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case 0: {
|
case 0: {
|
||||||
lore.add(toolStats.configTools.formatLore("created.created-by", "{player}", ownerName));
|
if (toolStats.configTools.checkConfig(original.getType(), "crafted-by")) {
|
||||||
|
lore.add(toolStats.configTools.formatLore("crafted.crafted-by", "{player}", ownerName));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "looted-by")) {
|
||||||
lore.add(toolStats.configTools.formatLore("looted.looted-by", "{player}", ownerName));
|
lore.add(toolStats.configTools.formatLore("looted.looted-by", "{player}", ownerName));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "traded-by")) {
|
||||||
lore.add(toolStats.configTools.formatLore("traded.traded-by", "{player}", ownerName));
|
lore.add(toolStats.configTools.formatLore("traded.traded-by", "{player}", ownerName));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case 4: {
|
|
||||||
lore.add(toolStats.configTools.formatLore("looted.found-by", "{player}", ownerName));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5: {
|
case 5: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "fished-by")) {
|
||||||
lore.add(toolStats.configTools.formatLore("fished.caught-by", "{player}", ownerName));
|
lore.add(toolStats.configTools.formatLore("fished.caught-by", "{player}", ownerName));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6: {
|
case 6: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "spawned-in-by")) {
|
||||||
lore.add(toolStats.configTools.formatLore("spawned-in.spawned-by", "{player}", ownerName));
|
lore.add(toolStats.configTools.formatLore("spawned-in.spawned-by", "{player}", ownerName));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (toolStats.configTools.checkConfig(original.getType(), "created-date")) {
|
|
||||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG)) {
|
if (container.has(toolStats.timeCreated, PersistentDataType.LONG)) {
|
||||||
Long time = container.get(toolStats.timeCreated, PersistentDataType.LONG);
|
Long time = container.get(toolStats.timeCreated, PersistentDataType.LONG);
|
||||||
if (time != null) {
|
if (time != null) {
|
||||||
@@ -321,29 +324,34 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
// show how when the item was created based on the previous lore
|
// show how when the item was created based on the previous lore
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case 0: {
|
case 0: {
|
||||||
lore.add(toolStats.configTools.formatLore("created.created-on", "{date}", date));
|
if (toolStats.configTools.checkConfig(original.getType(), "crafted-on")) {
|
||||||
|
lore.add(toolStats.configTools.formatLore("crafted.crafted-on", "{date}", date));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "looted-on")) {
|
||||||
lore.add(toolStats.configTools.formatLore("looted.looted-on", "{date}", date));
|
lore.add(toolStats.configTools.formatLore("looted.looted-on", "{date}", date));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "traded-on")) {
|
||||||
lore.add(toolStats.configTools.formatLore("traded.traded-on", "{date}", date));
|
lore.add(toolStats.configTools.formatLore("traded.traded-on", "{date}", date));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case 4: {
|
|
||||||
lore.add(toolStats.configTools.formatLore("looted.found-on", "{date}", date));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5: {
|
case 5: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "fished-on")) {
|
||||||
lore.add(toolStats.configTools.formatLore("fished.caught-on", "{date}", date));
|
lore.add(toolStats.configTools.formatLore("fished.caught-on", "{date}", date));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6: {
|
case 6: {
|
||||||
|
if (toolStats.configTools.checkConfig(original.getType(), "spawned-in-on")) {
|
||||||
lore.add(toolStats.configTools.formatLore("spawned-in.spawned-on", "{date}", date));
|
lore.add(toolStats.configTools.formatLore("spawned-in.spawned-on", "{date}", date));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,12 +139,12 @@ public class CraftItem implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if creation date is enabled, add it
|
// if creation date is enabled, add it
|
||||||
if (toolStats.configTools.checkConfig(itemStack.getType(), "created-date")) {
|
if (toolStats.configTools.checkConfig(itemStack.getType(), "crafted-on")) {
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
|
||||||
|
|
||||||
String date = toolStats.numberFormat.formatDate(finalDate);
|
String date = toolStats.numberFormat.formatDate(finalDate);
|
||||||
Component newLine = toolStats.configTools.formatLore("created.created-on", "{date}", date);
|
Component newLine = toolStats.configTools.formatLore("crafted.crafted-on", "{date}", date);
|
||||||
if (newLine == null) {
|
if (newLine == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -153,11 +153,11 @@ public class CraftItem implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if creation owner is enabled, add it
|
// if creation owner is enabled, add it
|
||||||
if (toolStats.configTools.checkConfig(itemStack.getType(), "created-by")) {
|
if (toolStats.configTools.checkConfig(itemStack.getType(), "crafted-by")) {
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
|
||||||
|
|
||||||
Component newLine = toolStats.configTools.formatLore("created.created-by", "{player}", owner.getName());
|
Component newLine = toolStats.configTools.formatLore("crafted.crafted-by", "{player}", owner.getName());
|
||||||
if (newLine == null) {
|
if (newLine == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -96,22 +97,45 @@ public class CreativeEvent implements Listener {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the current lore the item
|
||||||
|
List<Component> lore;
|
||||||
|
if (meta.hasLore()) {
|
||||||
|
lore = meta.lore();
|
||||||
|
} else {
|
||||||
|
lore = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(itemStack.getType(), "spawned-in-on")) {
|
||||||
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 6);
|
||||||
|
|
||||||
|
String date = toolStats.numberFormat.formatDate(finalDate);
|
||||||
|
Component newLine = toolStats.configTools.formatLore("spawned-in.spawned-on", "{date}", date);
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(itemStack.getType(), "spawned-in-by")) {
|
||||||
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 6);
|
||||||
|
|
||||||
|
Component newLine = toolStats.configTools.formatLore("spawned-in.spawned-by", "{player}", owner.getName());
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
// if hash is enabled, add it
|
// if hash is enabled, add it
|
||||||
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
||||||
String hash = toolStats.hashMaker.makeHash(newSpawnedItem.getType(), owner.getUniqueId(), timeCreated);
|
String hash = toolStats.hashMaker.makeHash(newSpawnedItem.getType(), owner.getUniqueId(), timeCreated);
|
||||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if spawned in is enabled, add it
|
|
||||||
if (toolStats.configTools.checkConfig(newSpawnedItem.getType(), "spawned-in")) {
|
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 6);
|
|
||||||
|
|
||||||
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
|
||||||
List<Component> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
|
|
||||||
meta.lore(newLore);
|
|
||||||
}
|
|
||||||
newSpawnedItem.setItemMeta(meta);
|
newSpawnedItem.setItemMeta(meta);
|
||||||
return newSpawnedItem;
|
return newSpawnedItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -102,26 +103,49 @@ public class GenerateLoot implements Listener {
|
|||||||
Date finalDate = new Date(timeCreated);
|
Date finalDate = new Date(timeCreated);
|
||||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||||
|
|
||||||
if (!toolStats.configTools.checkConfig(newItem.getType(), "looted-tag")) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only make the hash if it's enabled
|
// get the current lore the item
|
||||||
|
List<Component> lore;
|
||||||
|
if (meta.hasLore()) {
|
||||||
|
lore = meta.lore();
|
||||||
|
} else {
|
||||||
|
lore = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(newItem.getType(), "looted-on")) {
|
||||||
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
|
||||||
|
|
||||||
|
String date = toolStats.numberFormat.formatDate(finalDate);
|
||||||
|
Component newLine = toolStats.configTools.formatLore("looted.looted-on", "{date}", date);
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(newItem.getType(), "looted-by")) {
|
||||||
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
|
||||||
|
|
||||||
|
Component newLine = toolStats.configTools.formatLore("looted.looted-by", "{player}", owner.getName());
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if hash is enabled, add it
|
||||||
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
||||||
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
||||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
|
|
||||||
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
|
||||||
List<Component> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
|
|
||||||
meta.lore(newLore);
|
|
||||||
newItem.setItemMeta(meta);
|
newItem.setItemMeta(meta);
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -103,13 +104,25 @@ public class PickupItem implements Listener {
|
|||||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the current lore the item
|
||||||
|
List<Component> lore;
|
||||||
|
if (meta.hasLore()) {
|
||||||
|
lore = meta.lore();
|
||||||
|
} else {
|
||||||
|
lore = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 4);
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 4);
|
||||||
container.remove(toolStats.newElytra);
|
container.remove(toolStats.newElytra);
|
||||||
|
|
||||||
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
||||||
List<Component> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
|
Component dateCreatedLore = toolStats.configTools.formatLore("looted.found-on", "{date}", formattedDate);
|
||||||
meta.lore(newLore);
|
Component itemOwnerLore = toolStats.configTools.formatLore("looted.found-by", "{player}", owner.getName());
|
||||||
|
lore.add(dateCreatedLore);
|
||||||
|
lore.add(itemOwnerLore);
|
||||||
|
meta.lore(lore);
|
||||||
finalItem.setItemMeta(meta);
|
finalItem.setItemMeta(meta);
|
||||||
return finalItem;
|
return finalItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public class PlayerFish implements Listener {
|
|||||||
ItemStack caughtItem = ((Item) event.getCaught()).getItemStack();
|
ItemStack caughtItem = ((Item) event.getCaught()).getItemStack();
|
||||||
Item caughtItemEntity = (Item) event.getCaught();
|
Item caughtItemEntity = (Item) event.getCaught();
|
||||||
if (toolStats.itemChecker.isValidItem(caughtItem.getType())) {
|
if (toolStats.itemChecker.isValidItem(caughtItem.getType())) {
|
||||||
ItemStack newItem = addNewLore(caughtItem, player);
|
ItemStack newItem = addFishedOrigin(caughtItem, player);
|
||||||
if (newItem != null) {
|
if (newItem != null) {
|
||||||
caughtItemEntity.setItemStack(newItem);
|
caughtItemEntity.setItemStack(newItem);
|
||||||
}
|
}
|
||||||
@@ -102,7 +103,7 @@ public class PlayerFish implements Listener {
|
|||||||
* @param owner The player who caught it.
|
* @param owner The player who caught it.
|
||||||
* @return A copy of the new item with lore.
|
* @return A copy of the new item with lore.
|
||||||
*/
|
*/
|
||||||
private ItemStack addNewLore(ItemStack originalItem, Player owner) {
|
private ItemStack addFishedOrigin(ItemStack originalItem, Player owner) {
|
||||||
ItemStack newItem = originalItem.clone();
|
ItemStack newItem = originalItem.clone();
|
||||||
ItemMeta meta = originalItem.getItemMeta();
|
ItemMeta meta = originalItem.getItemMeta();
|
||||||
if (meta == null) {
|
if (meta == null) {
|
||||||
@@ -112,26 +113,49 @@ public class PlayerFish implements Listener {
|
|||||||
Date finalDate = new Date(timeCreated);
|
Date finalDate = new Date(timeCreated);
|
||||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||||
|
|
||||||
if (!toolStats.configTools.checkConfig(newItem.getType(), "fished-tag")) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only make the hash if it's enabled
|
// get the current lore the item
|
||||||
|
List<Component> lore;
|
||||||
|
if (meta.hasLore()) {
|
||||||
|
lore = meta.lore();
|
||||||
|
} else {
|
||||||
|
lore = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(newItem.getType(), "fished-on")) {
|
||||||
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 5);
|
||||||
|
|
||||||
|
String date = toolStats.numberFormat.formatDate(finalDate);
|
||||||
|
Component newLine = toolStats.configTools.formatLore("fished.caught-on", "{date}", date);
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(newItem.getType(), "fished-by")) {
|
||||||
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 5);
|
||||||
|
|
||||||
|
Component newLine = toolStats.configTools.formatLore("fished.caught-by", "{player}", owner.getName());
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if hash is enabled, add it
|
||||||
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
||||||
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
||||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 5);
|
|
||||||
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
|
||||||
List<Component> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
|
|
||||||
meta.lore(newLore);
|
|
||||||
newItem.setItemMeta(meta);
|
newItem.setItemMeta(meta);
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -133,22 +134,45 @@ public class VillagerTrade implements Listener {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toolStats.configTools.checkConfig(newItem.getType(), "traded-tag")) {
|
// get the current lore the item
|
||||||
return null;
|
List<Component> lore;
|
||||||
|
if (meta.hasLore()) {
|
||||||
|
lore = meta.lore();
|
||||||
|
} else {
|
||||||
|
lore = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// only make the hash if it's enabled
|
if (toolStats.configTools.checkConfig(newItem.getType(), "traded-on")) {
|
||||||
|
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 3);
|
||||||
|
|
||||||
|
String date = toolStats.numberFormat.formatDate(finalDate);
|
||||||
|
Component newLine = toolStats.configTools.formatLore("traded.traded-on", "{date}", date);
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toolStats.configTools.checkConfig(newItem.getType(), "traded-by")) {
|
||||||
|
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||||
|
container.set(toolStats.originType, PersistentDataType.INTEGER, 3);
|
||||||
|
|
||||||
|
Component newLine = toolStats.configTools.formatLore("traded.traded-by", "{player}", owner.getName());
|
||||||
|
if (newLine == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
lore.add(newLine);
|
||||||
|
meta.lore(lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if hash is enabled, add it
|
||||||
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
||||||
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
String hash = toolStats.hashMaker.makeHash(newItem.getType(), owner.getUniqueId(), timeCreated);
|
||||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
|
||||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
|
||||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 3);
|
|
||||||
String formattedDate = toolStats.numberFormat.formatDate(finalDate);
|
|
||||||
List<Component> newLore = toolStats.itemLore.addNewOwner(meta, owner.getName(), formattedDate);
|
|
||||||
meta.lore(newLore);
|
|
||||||
newItem.setItemMeta(meta);
|
newItem.setItemMeta(meta);
|
||||||
return newItem;
|
return newItem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,131 +102,6 @@ public class ItemLore {
|
|||||||
return newLore;
|
return newLore;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds new ownership to an item.
|
|
||||||
*
|
|
||||||
* @param itemMeta The item meta.
|
|
||||||
* @param playerName The new owner of item.
|
|
||||||
* @param formattedDate The date of the ownership.
|
|
||||||
* @return The item's new lore.
|
|
||||||
*/
|
|
||||||
public List<Component> addNewOwner(ItemMeta itemMeta, String playerName, String formattedDate) {
|
|
||||||
Component dateCreatedLore;
|
|
||||||
Component itemOwnerLore;
|
|
||||||
Integer origin = null;
|
|
||||||
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
|
|
||||||
if (container.has(toolStats.originType, PersistentDataType.INTEGER)) {
|
|
||||||
origin = container.get(toolStats.originType, PersistentDataType.INTEGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the origin is broken, don't try to set the lore
|
|
||||||
if (origin == null) {
|
|
||||||
toolStats.logger.info("Unable to determine origin for item " + itemMeta.getAsString());
|
|
||||||
toolStats.logger.info("This IS a bug, please report this to the GitHub.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the lore based on the origin
|
|
||||||
switch (origin) {
|
|
||||||
case 2: {
|
|
||||||
dateCreatedLore = toolStats.configTools.formatLore("looted.looted-on", "{date}", formattedDate);
|
|
||||||
itemOwnerLore = toolStats.configTools.formatLore("looted.looted-by", "{player}", playerName);
|
|
||||||
|
|
||||||
if (dateCreatedLore == null) {
|
|
||||||
toolStats.logger.warning("messages.looted.looted-on is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
if (itemOwnerLore == null) {
|
|
||||||
toolStats.logger.warning("messages.looted.looted-by is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 3: {
|
|
||||||
dateCreatedLore = toolStats.configTools.formatLore("traded.traded-on", "{date}", formattedDate);
|
|
||||||
itemOwnerLore = toolStats.configTools.formatLore("traded.traded-by", "{player}", playerName);
|
|
||||||
|
|
||||||
if (dateCreatedLore == null) {
|
|
||||||
toolStats.logger.warning("messages.traded.traded-on is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
if (itemOwnerLore == null) {
|
|
||||||
toolStats.logger.warning("messages.traded.traded-by is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 4: {
|
|
||||||
dateCreatedLore = toolStats.configTools.formatLore("looted.found-on", "{date}", formattedDate);
|
|
||||||
itemOwnerLore = toolStats.configTools.formatLore("looted.found-by", "{player}", playerName);
|
|
||||||
|
|
||||||
if (dateCreatedLore == null) {
|
|
||||||
toolStats.logger.warning("messages.looted.found-on is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
if (itemOwnerLore == null) {
|
|
||||||
toolStats.logger.warning("messages.looted.found-by is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: {
|
|
||||||
dateCreatedLore = toolStats.configTools.formatLore("fished.caught-on", "{date}", formattedDate);
|
|
||||||
itemOwnerLore = toolStats.configTools.formatLore("fished.caught-by", "{player}", playerName);
|
|
||||||
|
|
||||||
if (dateCreatedLore == null) {
|
|
||||||
toolStats.logger.warning("messages.fished.caught-on is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
if (itemOwnerLore == null) {
|
|
||||||
toolStats.logger.warning("messages.fished.caught-by is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6: {
|
|
||||||
dateCreatedLore = toolStats.configTools.formatLore("spawned-in.spawned-on", "{date}", formattedDate);
|
|
||||||
itemOwnerLore = toolStats.configTools.formatLore("spawned-in.spawned-by", "{player}", playerName);
|
|
||||||
|
|
||||||
if (dateCreatedLore == null) {
|
|
||||||
toolStats.logger.warning("messages.spawned-in.spawned-on is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
if (itemOwnerLore == null) {
|
|
||||||
toolStats.logger.warning("messages.spawned-in.spawned-by is not set in your config!");
|
|
||||||
toolStats.logger.warning("Unable to update lore for item.");
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
toolStats.logger.warning("Origin " + origin + " was found. Data was modified OR something REALLY broke.");
|
|
||||||
toolStats.logger.warning(itemMeta.getAsString());
|
|
||||||
return itemMeta.lore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Component> newLore;
|
|
||||||
if (itemMeta.hasLore()) {
|
|
||||||
newLore = itemMeta.lore();
|
|
||||||
} else {
|
|
||||||
newLore = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
newLore.add(dateCreatedLore);
|
|
||||||
newLore.add(itemOwnerLore);
|
|
||||||
return newLore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add x to the crops mined stat.
|
* Add x to the crops mined stat.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ public class ConfigTools {
|
|||||||
* @return If we want to add data or not.
|
* @return If we want to add data or not.
|
||||||
*/
|
*/
|
||||||
public boolean checkConfig(Material material, String configName) {
|
public boolean checkConfig(Material material, String configName) {
|
||||||
|
if (toolStats.config.getConfigurationSection("enabled." + configName) == null) {
|
||||||
|
toolStats.logger.warning("Missing config section for enabled" + configName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
String itemName = material.toString().toLowerCase();
|
String itemName = material.toString().toLowerCase();
|
||||||
String itemType = null;
|
String itemType = null;
|
||||||
// hardcode these
|
// hardcode these
|
||||||
@@ -75,7 +80,6 @@ public class ConfigTools {
|
|||||||
} else {
|
} else {
|
||||||
itemType = itemName.substring(itemName.indexOf('_') + 1);
|
itemType = itemName.substring(itemName.indexOf('_') + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (itemType) {
|
return switch (itemType) {
|
||||||
case "pickaxe" -> toolStats.config.getBoolean("enabled." + configName + ".pickaxe");
|
case "pickaxe" -> toolStats.config.getBoolean("enabled." + configName + ".pickaxe");
|
||||||
case "sword" -> toolStats.config.getBoolean("enabled." + configName + ".sword");
|
case "sword" -> toolStats.config.getBoolean("enabled." + configName + ".sword");
|
||||||
|
|||||||
@@ -61,5 +61,10 @@ public class ConfigUpdater {
|
|||||||
Version11 version11 = new Version11(toolStats);
|
Version11 version11 = new Version11(toolStats);
|
||||||
version11.update();
|
version11.update();
|
||||||
}
|
}
|
||||||
|
// Version 11 to 12
|
||||||
|
if (version == 11) {
|
||||||
|
Version12 version12 = new Version12(toolStats);
|
||||||
|
version12.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ToolStats.
|
||||||
|
*
|
||||||
|
* ToolStats is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* ToolStats is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package lol.hyper.toolstats.tools.config.versions;
|
||||||
|
|
||||||
|
import it.unimi.dsi.fastutil.Pair;
|
||||||
|
import lol.hyper.toolstats.ToolStats;
|
||||||
|
import org.bukkit.configuration.Configuration;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.Deque;
|
||||||
|
|
||||||
|
public class Version12 {
|
||||||
|
|
||||||
|
private final ToolStats toolStats;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for updating from version 11 to 12.
|
||||||
|
*
|
||||||
|
* @param toolStats ToolStats instance.
|
||||||
|
*/
|
||||||
|
public Version12(ToolStats toolStats) {
|
||||||
|
this.toolStats = toolStats;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform the config update.
|
||||||
|
*/
|
||||||
|
public void update() {
|
||||||
|
// save the old config first
|
||||||
|
try {
|
||||||
|
toolStats.config.save("plugins" + File.separator + "ToolStats" + File.separator + "config-11.yml");
|
||||||
|
} catch (IOException exception) {
|
||||||
|
toolStats.logger.severe("Unable to save config-11.yml!");
|
||||||
|
throw new RuntimeException(exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
toolStats.logger.info("Updating config.yml to version 12.");
|
||||||
|
toolStats.config.set("config-version", 12);
|
||||||
|
|
||||||
|
transfer("enabled.created-by", "enabled.crafted-by");
|
||||||
|
transfer("enabled.created-date", "enabled.crafted-on");
|
||||||
|
|
||||||
|
transfer("enabled.fished-tag", "enabled.fished-by");
|
||||||
|
transfer("enabled.fished-tag", "enabled.fished-on");
|
||||||
|
|
||||||
|
transfer("enabled.looted-tag", "enabled.looted-by");
|
||||||
|
transfer("enabled.looted-tag", "enabled.looted-on");
|
||||||
|
|
||||||
|
transfer("enabled.traded-tag", "enabled.traded-by");
|
||||||
|
transfer("enabled.traded-tag", "enabled.traded-on");
|
||||||
|
|
||||||
|
transfer("enabled.spawned-in", "enabled.spawned-in-by");
|
||||||
|
transfer("enabled.spawned-in", "enabled.spawned-in-on");
|
||||||
|
|
||||||
|
transfer("messages.created", "messages.crafted");
|
||||||
|
|
||||||
|
toolStats.config.set("enabled.created-by", null);
|
||||||
|
toolStats.config.set("enabled.created-date", null);
|
||||||
|
toolStats.config.set("enabled.fished-tag", null);
|
||||||
|
toolStats.config.set("enabled.looted-tag", null);
|
||||||
|
toolStats.config.set("enabled.traded-tag", null);
|
||||||
|
toolStats.config.set("enabled.spawned-in", null);
|
||||||
|
|
||||||
|
|
||||||
|
// rename crafted to crafted here
|
||||||
|
// copy the old ones first
|
||||||
|
String craftedByMessage = toolStats.config.getString("messages.created.created-by");
|
||||||
|
String craftedOnMessage = toolStats.config.getString("messages.created.created-on");
|
||||||
|
|
||||||
|
toolStats.config.set("messages.created", null);
|
||||||
|
toolStats.config.set("messages.crafted.created-by", null);
|
||||||
|
toolStats.config.set("messages.crafted.created-on", null);
|
||||||
|
|
||||||
|
toolStats.config.set("messages.crafted.crafted-by", craftedByMessage);
|
||||||
|
toolStats.config.set("messages.crafted.crafted-on", craftedOnMessage);
|
||||||
|
|
||||||
|
// save the config and reload it
|
||||||
|
try {
|
||||||
|
toolStats.config.save("plugins" + File.separator + "ToolStats" + File.separator + "config.yml");
|
||||||
|
} catch (IOException exception) {
|
||||||
|
toolStats.logger.severe("Unable to save config.yml!");
|
||||||
|
throw new RuntimeException(exception);
|
||||||
|
}
|
||||||
|
toolStats.loadConfig();
|
||||||
|
toolStats.logger.info("Config has been updated to version 12. A copy of version 11 has been saved as config-11.yml");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void transfer(String oldSection, String newSection) {
|
||||||
|
toolStats.logger.info("Moving " + oldSection + " to " + newSection);
|
||||||
|
ConfigurationSection old = toolStats.config.getConfigurationSection(oldSection);
|
||||||
|
toolStats.config.set(newSection, old);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,8 +66,8 @@ tokens:
|
|||||||
levels: 1
|
levels: 1
|
||||||
|
|
||||||
enabled:
|
enabled:
|
||||||
# Will show ownership of items when they are created/found.
|
# Will show "Crafted by <player>"
|
||||||
created-by:
|
crafted-by:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -78,8 +78,8 @@ enabled:
|
|||||||
armor: true
|
armor: true
|
||||||
mace: true
|
mace: true
|
||||||
fishing-rod: true
|
fishing-rod: true
|
||||||
# Will show time the item is created
|
# Will show "Crafted on <date>"
|
||||||
created-date:
|
crafted-on:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -91,7 +91,18 @@ enabled:
|
|||||||
mace: true
|
mace: true
|
||||||
fishing-rod: true
|
fishing-rod: true
|
||||||
# Will show "Fished by <player>"
|
# Will show "Fished by <player>"
|
||||||
fished-tag:
|
fished-by:
|
||||||
|
pickaxe: true
|
||||||
|
sword: true
|
||||||
|
shovel: true
|
||||||
|
axe: true
|
||||||
|
hoe: true
|
||||||
|
shears: true
|
||||||
|
bow: true
|
||||||
|
armor: true
|
||||||
|
fishing-rod: true
|
||||||
|
# Will show "Fished on <date>"
|
||||||
|
fished-on:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -102,7 +113,7 @@ enabled:
|
|||||||
armor: true
|
armor: true
|
||||||
fishing-rod: true
|
fishing-rod: true
|
||||||
# Will show "Found by <player>"
|
# Will show "Found by <player>"
|
||||||
looted-tag:
|
looted-by:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -112,8 +123,30 @@ enabled:
|
|||||||
bow: true
|
bow: true
|
||||||
armor: true
|
armor: true
|
||||||
fishing-rod: true
|
fishing-rod: true
|
||||||
# Will show "Trade by <player>"
|
# Will show "Found on <date>"
|
||||||
traded-tag:
|
looted-on:
|
||||||
|
pickaxe: true
|
||||||
|
sword: true
|
||||||
|
shovel: true
|
||||||
|
axe: true
|
||||||
|
hoe: true
|
||||||
|
shears: true
|
||||||
|
bow: true
|
||||||
|
armor: true
|
||||||
|
fishing-rod: true
|
||||||
|
# Will show "Traded by <player>"
|
||||||
|
traded-by:
|
||||||
|
pickaxe: true
|
||||||
|
sword: true
|
||||||
|
shovel: true
|
||||||
|
axe: true
|
||||||
|
hoe: true
|
||||||
|
shears: true
|
||||||
|
bow: true
|
||||||
|
armor: true
|
||||||
|
fishing-rod: true
|
||||||
|
# Will show "Traded on <date>"
|
||||||
|
traded-on:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -148,7 +181,19 @@ enabled:
|
|||||||
hoe: true
|
hoe: true
|
||||||
shears: true
|
shears: true
|
||||||
# Will show "Spawned in by <player>"
|
# Will show "Spawned in by <player>"
|
||||||
spawned-in:
|
spawned-in-by:
|
||||||
|
pickaxe: true
|
||||||
|
sword: true
|
||||||
|
shovel: true
|
||||||
|
axe: true
|
||||||
|
hoe: true
|
||||||
|
shears: true
|
||||||
|
bow: true
|
||||||
|
armor: true
|
||||||
|
mace: true
|
||||||
|
fishing-rod: true
|
||||||
|
# Will show "Spawned in on <date>"
|
||||||
|
spawned-in-on:
|
||||||
pickaxe: true
|
pickaxe: true
|
||||||
sword: true
|
sword: true
|
||||||
shovel: true
|
shovel: true
|
||||||
@@ -169,9 +214,9 @@ enabled:
|
|||||||
crops-harvested: true
|
crops-harvested: true
|
||||||
|
|
||||||
messages:
|
messages:
|
||||||
created:
|
crafted:
|
||||||
created-by: "&7Crafted by: &8{player}"
|
crafted-by: "&7Crafted by: &8{player}"
|
||||||
created-on: "&7Crafted on: &8{date}"
|
crafted-on: "&7Crafted on: &8{date}"
|
||||||
fished:
|
fished:
|
||||||
caught-by: "&7Caught by: &8{player}"
|
caught-by: "&7Caught by: &8{player}"
|
||||||
caught-on: "&7Caught on: &8{date}"
|
caught-on: "&7Caught on: &8{date}"
|
||||||
|
|||||||
Reference in New Issue
Block a user