diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-08-12 07:25:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-12 07:25:45 +0800 |
commit | b83793c10aca3d4697fe3186afa424fe2b90234d (patch) | |
tree | 30c1e4a8a6a14c8013b5e4b2eeb55b30fa5798b4 /features/globalSettings | |
parent | 9baf64bc9e28295cea392184d52df05a569257a2 (diff) | |
download | SoopyV2-b83793c10aca3d4697fe3186afa424fe2b90234d.tar.gz SoopyV2-b83793c10aca3d4697fe3186afa424fe2b90234d.tar.bz2 SoopyV2-b83793c10aca3d4697fe3186afa424fe2b90234d.zip |
use nbt things
Diffstat (limited to 'features/globalSettings')
-rw-r--r-- | features/globalSettings/index.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 5454039..e95f118 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -325,11 +325,8 @@ class GlobalSettings extends Feature { } if (thunder) { if (ItemName.removeFormatting().includes("Empty Thunder Bottle")) { - i.getLore().forEach(Line => { - if (Line.includes("Charge:")) { - thunderText.push("&5Thunder Bottle " + Line) - } - }) + let charges = i?.getNBT()?.getCompoundTag("tag")?.getCompoundTag("ExtraAttributes")?.getDouble("thunder_charge") + thunderText.push("&5Thunder Bottle Charges: &e" + numberWithCommas(charges) + "&6/&e50,000") } } } @@ -338,9 +335,9 @@ class GlobalSettings extends Feature { let newItem = i if (!oldItem && !newItem) return //they both are air if (j > 36 || j == 9) return //sbmenu and armors (when switching wardrobe it goes brrr w/o this) - let oldItemAmount = oldItem ? oldItem.getNBT().toObject()?.Count : undefined + let oldItemAmount = oldItem ? oldItem.getNBT().getDouble("Count") : undefined let oldItemName = oldItem ? oldItem.getName() : "" - let newItemAmount = newItem ? newItem.getNBT().toObject()?.Count : undefined + let newItemAmount = newItem ? newItem.getNBT().getDouble("Count") : undefined let newItemName = newItem ? newItem.getName() : "" this.oldItemData[j] = newItem if (oldItemName === newItemName) { //only amount is changed |