rename things

This commit is contained in:
hyperdefined
2025-01-26 14:43:47 -05:00
parent 73e472af3a
commit f7697bccfa
13 changed files with 63 additions and 63 deletions

View File

@@ -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;
}

View File

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

View File

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

View File

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

View File

@@ -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;
}

View File

@@ -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;
}

View File

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

View File

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

View File

@@ -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;
}

View File

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