mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2026-02-04 11:31:02 +00:00
rename things
This commit is contained in:
@@ -34,11 +34,11 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class BlocksMined implements Listener {
|
||||
public class BlockBreak implements Listener {
|
||||
|
||||
private final ToolStats toolStats;
|
||||
|
||||
public BlocksMined(ToolStats toolStats) {
|
||||
public BlockBreak(ToolStats toolStats) {
|
||||
this.toolStats = toolStats;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public class CraftItem implements Listener {
|
||||
|
||||
// if the item already has the tag
|
||||
// this is to prevent duplicate tags
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.genericOwner, PersistentDataType.LONG)) {
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ public class CraftItem implements Listener {
|
||||
}
|
||||
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 0);
|
||||
|
||||
List<Component> lore;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CreativeEvent implements Listener {
|
||||
}
|
||||
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 6);
|
||||
|
||||
if (toolStats.configTools.checkConfig(newSpawnedItem.getType(), "spawned-in")) {
|
||||
|
||||
@@ -102,7 +102,7 @@ public class GenerateLoot implements Listener {
|
||||
Date finalDate = new Date(timeCreated);
|
||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.genericOwner, PersistentDataType.LONG)) {
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class GenerateLoot implements Listener {
|
||||
}
|
||||
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 2);
|
||||
|
||||
if (toolStats.configTools.checkConfig(newItem.getType(), "looted-tag")) {
|
||||
|
||||
@@ -108,17 +108,17 @@ public class GrindstoneEvent implements Listener {
|
||||
for (String token : tokens) {
|
||||
switch (appliedTokens) {
|
||||
case "player-kills": {
|
||||
container.set(toolStats.swordPlayerKills, PersistentDataType.INTEGER, 0);
|
||||
container.set(toolStats.playerKills, PersistentDataType.INTEGER, 0);
|
||||
finalMeta = toolStats.itemLore.updatePlayerKills(inputItem, 0);
|
||||
break;
|
||||
}
|
||||
case "mob-kills": {
|
||||
container.set(toolStats.swordMobKills, PersistentDataType.INTEGER, 0);
|
||||
container.set(toolStats.mobKills, PersistentDataType.INTEGER, 0);
|
||||
finalMeta = toolStats.itemLore.updateMobKills(inputItem, 0);
|
||||
break;
|
||||
}
|
||||
case "blocks-mined": {
|
||||
container.set(toolStats.genericMined, PersistentDataType.INTEGER, 0);
|
||||
container.set(toolStats.blocksMined, PersistentDataType.INTEGER, 0);
|
||||
finalMeta = toolStats.itemLore.updateBlocksMined(inputItem, 0);
|
||||
break;
|
||||
}
|
||||
@@ -128,12 +128,12 @@ public class GrindstoneEvent implements Listener {
|
||||
break;
|
||||
}
|
||||
case "fish-caught": {
|
||||
container.set(toolStats.fishingRodCaught, PersistentDataType.INTEGER, 0);
|
||||
container.set(toolStats.fishCaught, PersistentDataType.INTEGER, 0);
|
||||
finalMeta = toolStats.itemLore.updateFishCaught(inputItem, 0);
|
||||
break;
|
||||
}
|
||||
case "sheep-sheared": {
|
||||
container.set(toolStats.shearsSheared, PersistentDataType.INTEGER, 0);
|
||||
container.set(toolStats.sheepSheared, PersistentDataType.INTEGER, 0);
|
||||
finalMeta = toolStats.itemLore.updateSheepSheared(inputItem, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ public class InventoryOpen implements Listener {
|
||||
if (toolStats.config.getBoolean("generate-hash-for-items")) {
|
||||
if (!container.has(toolStats.hash, PersistentDataType.STRING)) {
|
||||
// make sure the item has an owner
|
||||
if (!container.has(toolStats.genericOwner, new UUIDDataType())) {
|
||||
if (!container.has(toolStats.itemOwner, new UUIDDataType())) {
|
||||
continue;
|
||||
}
|
||||
UUID owner = container.get(toolStats.genericOwner, new UUIDDataType());
|
||||
UUID owner = container.get(toolStats.itemOwner, new UUIDDataType());
|
||||
if (owner == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class PickupItem implements Listener {
|
||||
}
|
||||
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 4);
|
||||
container.remove(toolStats.newElytra);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class PlayerFish implements Listener {
|
||||
Date finalDate = new Date(timeCreated);
|
||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.genericOwner, PersistentDataType.LONG)) {
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PlayerFish implements Listener {
|
||||
|
||||
container.set(toolStats.hash, PersistentDataType.STRING, hash);
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 5);
|
||||
|
||||
if (toolStats.configTools.checkConfig(newItem.getType(), "fished-tag")) {
|
||||
|
||||
@@ -61,10 +61,10 @@ public class PlayerJoin implements Listener {
|
||||
// generate a hash if the item doesn't have one
|
||||
if (!container.has(toolStats.hash, PersistentDataType.STRING)) {
|
||||
// make sure the item has an owner
|
||||
if (!container.has(toolStats.genericOwner, new UUIDDataType())) {
|
||||
if (!container.has(toolStats.itemOwner, new UUIDDataType())) {
|
||||
continue;
|
||||
}
|
||||
UUID owner = container.get(toolStats.genericOwner, new UUIDDataType());
|
||||
UUID owner = container.get(toolStats.itemOwner, new UUIDDataType());
|
||||
if (owner == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class VillagerTrade implements Listener {
|
||||
Date finalDate = new Date(timeCreated);
|
||||
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.genericOwner, PersistentDataType.LONG)) {
|
||||
if (container.has(toolStats.timeCreated, PersistentDataType.LONG) || container.has(toolStats.itemOwner, PersistentDataType.LONG)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class VillagerTrade implements Listener {
|
||||
}
|
||||
|
||||
container.set(toolStats.timeCreated, PersistentDataType.LONG, timeCreated);
|
||||
container.set(toolStats.genericOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.itemOwner, new UUIDDataType(), owner.getUniqueId());
|
||||
container.set(toolStats.originType, PersistentDataType.INTEGER, 3);
|
||||
|
||||
if (toolStats.configTools.checkConfig(newItem.getType(), "traded-tag")) {
|
||||
|
||||
Reference in New Issue
Block a user