Skip to content

Commit 9746789

Browse files
committed
added int damage value
1 parent fd3c3ca commit 9746789

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>lol.hyper</groupId>
2525
<artifactId>toolstats</artifactId>
26-
<version>1.6</version>
26+
<version>1.6.1</version>
2727
<packaging>jar</packaging>
2828

2929
<name>ToolStats</name>

src/main/java/lol/hyper/toolstats/ToolStats.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public final class ToolStats extends JavaPlugin {
5555
public final NamespacedKey shearsSheared = new NamespacedKey(this, "sheared");
5656
// stores how much damage armor has taken
5757
public final NamespacedKey armorDamage = new NamespacedKey(this, "damage-taken");
58+
// stores how much damage armor has taken (as int)
59+
public final NamespacedKey armorDamageInt = new NamespacedKey(this, "damage-taken-int");
5860
// used for tracking new elytras
5961
public final NamespacedKey newElytra = new NamespacedKey(this, "new");
6062

src/main/java/lol/hyper/toolstats/events/EntityDamage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ private void updateDamage(ItemStack itemStack, double damage) {
316316

317317
damageTaken = damageTaken + damage;
318318
container.set(toolStats.armorDamage, PersistentDataType.DOUBLE, damageTaken);
319+
container.set(toolStats.armorDamageInt, PersistentDataType.INTEGER, damageTaken.intValue());
319320

320321
String damageTakenFormatted = toolStats.numberFormat.formatDouble(damageTaken);
321322
List<String> newLore = toolStats.itemLore.addItemLore(meta, "{damage}", damageTakenFormatted, "damage-taken");

0 commit comments

Comments
 (0)