diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-06-06 13:27:49 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-06-06 13:27:49 +0800 |
commit | 091590d76e30797ec27a143129146904c14dd2b3 (patch) | |
tree | c3a10caedb0934f07ac41d5e00d96f6817be43c6 /features | |
parent | 80df8e23c4c4fea6e6c4f438151842070707116a (diff) | |
download | SoopyV2-091590d76e30797ec27a143129146904c14dd2b3.tar.gz SoopyV2-091590d76e30797ec27a143129146904c14dd2b3.tar.bz2 SoopyV2-091590d76e30797ec27a143129146904c14dd2b3.zip |
+ dungeon routes stuff
+ wing changes
Diffstat (limited to 'features')
-rw-r--r-- | features/cosmetics/cosmetic/dragon/dragonWings.js | 4 | ||||
-rw-r--r-- | features/dungeonRoutes/index.js | 41 |
2 files changed, 36 insertions, 9 deletions
diff --git a/features/cosmetics/cosmetic/dragon/dragonWings.js b/features/cosmetics/cosmetic/dragon/dragonWings.js index f050141..fc447d3 100644 --- a/features/cosmetics/cosmetic/dragon/dragonWings.js +++ b/features/cosmetics/cosmetic/dragon/dragonWings.js @@ -145,7 +145,7 @@ class DragonWings extends Cosmetic { if (!this.player.getPlayer()[m.isPlayerSleeping]()) { //dont rotate when in bed Tessellator.rotate((180 - rotation), 0, 1, 0) - Tessellator.translate(0, 1.2, 0.1) + Tessellator.translate(0, 1.2, 0.13) if (this.player.getPlayer()[m.isSneaking.Entity]()) { //isSneaking Tessellator.translate(0, -0.125, 0) @@ -224,7 +224,7 @@ class DragonWings extends Cosmetic { // console.log(World.getBlockAt(this.player.getX(), this.player.getY(), this.player.getZ()).getState().func_177229_b(FACING)) Tessellator.rotate(rotation, 0, 1, 0) } catch (e) { } - Tessellator.translate(0, -this.settings.scale * 25, 0) + Tessellator.translate(0, - this.settings.scale * 25, 0) wing[f.rotateAngleX] = 0; //rotateAngleX diff --git a/features/dungeonRoutes/index.js b/features/dungeonRoutes/index.js index f2d6757..84c5409 100644 --- a/features/dungeonRoutes/index.js +++ b/features/dungeonRoutes/index.js @@ -21,6 +21,7 @@ class DungeonRoutes extends Feature { this.recentEtherwarps = [] this.recentMines = [] this.recentLocations = [] + this.recentTnts = [] this.lastLocationUpdatedTime = Date.now() this.registerEvent("soundPlay", this.playSound) @@ -28,13 +29,13 @@ class DungeonRoutes extends Feature { this.registerStep(true, 5, () => { if (this.recentLocations.length === 0 - || Math.trunc(Player.getX()) !== this.recentLocations[this.recentLocations.length - 1].loc[0] - || Math.trunc(Player.getY()) !== this.recentLocations[this.recentLocations.length - 1].loc[1] - || Math.trunc(Player.getZ()) !== this.recentLocations[this.recentLocations.length - 1].loc[2]) { + || Math.ceil(Player.getX()) !== this.recentLocations[this.recentLocations.length - 1].loc[0] + || Math.ceil(Player.getY()) !== this.recentLocations[this.recentLocations.length - 1].loc[1] + || Math.ceil(Player.getZ()) !== this.recentLocations[this.recentLocations.length - 1].loc[2]) { - this.recentLocations.push({ loc: [Math.trunc(Player.getX()), Math.trunc(Player.getY()), Math.trunc(Player.getZ())], id: this.actionId++ }) + this.recentLocations.push({ loc: [Math.ceil(Player.getX()), Math.ceil(Player.getY()), Math.ceil(Player.getZ())], id: this.actionId++ }) - if (this.recentLocations.length > 50) this.recentLocations.shift() + this.checkForRemove() } }) @@ -53,13 +54,39 @@ class DungeonRoutes extends Feature { worldLoad() { this.recentEtherwarps = [] this.recentMines = [] + this.recentLocations = [] + this.recentTnts = [] + } + + checkForRemove() { + if (this.recentLocations.length + this.recentMines.length + this.recentEtherwarps.length + this.recentTnts.length > 50) { + let arrs = [this.recentLocations, this.recentMines, this.recentEtherwarps, this.recentTnts] + let smallestArr = undefined + + if (this.recentLocations[0].id < this.recentMines[0].id && this.recentLocations[0].id < this.recentEtherwarps[0].id) { + this.recentLocations.shift() + return + } + if (this.recentMines[0].id < this.recentLocations[0].id && this.recentMines[0].id < this.recentEtherwarps[0].id) { + this.recentMines.shift() + return + } + if (this.recentEtherwarps[0].id < this.recentMines[0].id && this.recentEtherwarps[0].id < this.recentLocations[0].id) { + this.recentEtherwarps.shift() + return + } + } } playSound(pos, name, volume, pitch, categoryName, event) { let nameSplitted = name.split(".") if (name === "mob.enderdragon.hit") { //etherwarp this.recentEtherwarps.push({ loc: pos, id: this.actionId++ }) - if (this.recentEtherwarps.length > 10) this.recentEtherwarps.shift() + this.checkForRemove() + } + if (name === "random.explode") { //etherwarp + this.recentTnts.push({ loc: pos, id: this.actionId++ }) + this.checkForRemove() } if (nameSplitted[0] === "dig") { //mining block if (!this.recentMines.some(a => @@ -68,7 +95,7 @@ class DungeonRoutes extends Feature { && a.loc.z === pos.z )) { this.recentMines.push({ loc: pos, id: this.actionId++ }) - if (this.recentMines.length > 10) this.recentMines.shift() + this.checkForRemove() } } } |