Skip to content

Commit 3dbe46f

Browse files
committed
Scoreboard Tested
1 parent 12cf7ea commit 3dbe46f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/con-database/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ class ScoreboardDatabaseManager extends Map{
482482
/**@private */
483483
hasChanges = false;
484484
/**@readonly */
485-
get maxLength(){return 32e3;}
485+
get maxLength(){return 30e3;}
486486
/**@private @type {ScoreboardObjective}*/
487487
_scoreboard_;
488488
/**@protected @type {Map<string,string|ScoreboardIdentity|Entity>} */
@@ -505,7 +505,7 @@ class ScoreboardDatabaseManager extends Map{
505505
this._changes_ = new Map();
506506
if(this._saveMode_ === DatabaseSavingModes.TickInterval){
507507
system.runInterval(()=>{
508-
if(!this.hasChanges){
508+
if(this.hasChanges){
509509
endTickCall(()=>{
510510
for (const [k,{action,value}] of this._changes_.entries()) run(this,k,value,action);
511511
this._changes_.clear();
@@ -544,7 +544,7 @@ class ScoreboardDatabaseManager extends Map{
544544
if(!this._loaded_) throw new ReferenceError("Database is not loaded");
545545
const newValue = `${key}${split}${this._parser_.stringify(value)}`;
546546
if(newValue.length > this.maxLength) throw new RangeError("Value is too large for one property");
547-
super.set(key,newValue);
547+
super.set(key,value);
548548
this._onChange_(key,newValue,ChangeAction.Change);
549549
return this;
550550
}

scripts/con-database/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { JsonDatabase } from "./index";
22

3-
const a = new JsonDatabase("Josh").load();
4-
a.set("trololo",(a.get("bob")??0) + 1);
3+
const a = new JsonDatabase("SUS").load();
4+
a.set("sussy",(a.get("sussy")??0) + 1);
55

6-
console.warn("Current trololo count is " + a.get("trololo"));
6+
console.warn("Current sussy count is " + a.get("sussy"));

0 commit comments

Comments
 (0)