@dra2020/baseclient 1.0.92 → 1.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2882,6 +2882,7 @@ exports.reverseBlockMapping = reverseBlockMapping;
2882
2882
  class MultiBlockMapping {
2883
2883
  constructor(tag, bm) {
2884
2884
  this.entries = [];
2885
+ this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
2885
2886
  if (tag && bm)
2886
2887
  this.entries.push({ tag, bm });
2887
2888
  }
@@ -2893,11 +2894,14 @@ class MultiBlockMapping {
2893
2894
  } });
2894
2895
  if (bm)
2895
2896
  this.entries.push({ tag, bm });
2897
+ this.stamp++;
2896
2898
  }
2897
2899
  remove(tag) {
2898
2900
  for (let i = this.entries.length - 1; i >= 0; i--)
2899
- if (this.entries[i].tag === tag)
2901
+ if (this.entries[i].tag === tag) {
2902
+ this.stamp++;
2900
2903
  this.entries.splice(i, 1);
2904
+ }
2901
2905
  }
2902
2906
  map(blockid) {
2903
2907
  // Walk backwards to pick up overrides first
@@ -2908,6 +2912,12 @@ class MultiBlockMapping {
2908
2912
  }
2909
2913
  return undefined;
2910
2914
  }
2915
+ multimap(blockid) {
2916
+ let a = [];
2917
+ this.entries.forEach(e => { if (e.bm[blockid])
2918
+ a.push(e.bm[blockid]); });
2919
+ return a;
2920
+ }
2911
2921
  bmOf(tag) {
2912
2922
  let e = this.entries.find(e => e.tag === tag);
2913
2923
  return e ? e.bm : null;