Skip to content

Commit

Permalink
Added autoclearmarks toggle. Defaults to 'false'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeems committed Jun 11, 2021
1 parent 3590d9a commit 6fd82cf
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Author: TheBeems (Mathijs Beemsterboer)
* Initial release: 2021-04-07
* Last modified: 2021-06-04
* Last modified: 2021-06-11
* Description: Making building inside Minecraft:Education Edition a little easier.
*
*/
Expand Down Expand Up @@ -41,9 +41,10 @@
* Class with the Data and settings.
*/
class Data {
static sVersion: string = "1.5.6";
static sVersion: string = "1.5.7";
static bDebug: boolean = true;
static bShowMark: boolean = true;
static bAutoClearMarks: boolean = false;
static aMarks: Position[] = [];
static nMarkBlock: number = MAGENTA_CARPET;
static nBuildBlock: number = GRASS;
Expand Down Expand Up @@ -503,6 +504,7 @@ namespace marks {
}

if (pMark == undefined && nIndex == undefined) {
console.print(`Please wait, while the marks are being removed.`);
// When no position was given, loop to delete all marks.
while (Data.aMarks.length) {
let pMark = marks.getLast();
Expand Down Expand Up @@ -939,6 +941,23 @@ player.onChatCommandCore("showmarks", function(){




/**
* Toggles between auto removing marks after building
*/
player.onChatCommandCore("autoclearmarks", function(){
if (Data.bAutoClearMarks) {
Data.bAutoClearMarks = false;
}
else {
Data.bAutoClearMarks = true;
}
})





/**
* Toggles between showing and hidding the marks in the world.
*/
Expand Down Expand Up @@ -1176,6 +1195,10 @@ namespace shapes {
Data.oShape.nBlockID = 0;
Data.oShape.nBlockData = 0;
Data.oShape.sAction = "";

if (Data.bAutoClearMarks) {
marks.remove(); // remove all the marks.
}
}


Expand Down

0 comments on commit 6fd82cf

Please sign in to comment.