@@ -5,8 +5,8 @@ import { EntityState } from '@nxg-org/mineflayer-physics-util'
55import { BreakHandler , PlaceHandler } from './movements/interactionUtils'
66const emptyVec = new Vec3 ( 0 , 0 , 0 )
77
8- const TOPLACE : PlaceHandler [ ] = [ ]
9- const TOBREAK : BreakHandler [ ] = [ ]
8+ // const TOPLACE: PlaceHandler[] = []
9+ // const TOBREAK: BreakHandler[] = []
1010
1111export class Move implements PathData {
1212 hash : string
@@ -23,8 +23,8 @@ export class Move implements PathData {
2323 public readonly x : number ,
2424 public readonly y : number ,
2525 public readonly z : number ,
26- // toPlace: PlaceHandler[],
27- // toBreak: BreakHandler[],
26+ toPlace : PlaceHandler [ ] ,
27+ toBreak : BreakHandler [ ] ,
2828 public readonly remainingBlocks : number ,
2929 public readonly cost : number ,
3030 public readonly moveType : MovementProvider ,
@@ -44,16 +44,18 @@ export class Move implements PathData {
4444 this . cachedVec = new Vec3 ( this . x , this . y , this . z )
4545 Object . freeze ( this . cachedVec )
4646
47- this . toPlace = TOPLACE
48- this . toBreak = TOBREAK
47+ // this.toPlace = TOPLACE
48+ // this.toBreak = TOBREAK
49+ this . toPlace = toPlace
50+ this . toBreak = toBreak
4951 // this.x = x;
5052 // this.y = y;
5153 // this.z = z;
5254 // this.hash = this.x.toFixed(1) + "," + this.y.toFixed(1) + "," + this.z.toFixed(1);
5355 }
5456
5557 static startMove ( type : MovementProvider , pos : Vec3 , vel : Vec3 , remainingBlocks : number ) : Move {
56- return new Move ( pos . x , pos . y , pos . z , remainingBlocks , 0 , type , pos , vel , pos , vel )
58+ return new Move ( pos . x , pos . y , pos . z , [ ] , [ ] , remainingBlocks , 0 , type , pos , vel , pos , vel )
5759 // new Map());
5860 }
5961
@@ -62,8 +64,8 @@ export class Move implements PathData {
6264 state : EntityState ,
6365 prevMove : Move ,
6466 type : MovementProvider ,
65- // toPlace: PlaceHandler[] = [],
66- // toBreak: BreakHandler[] = []
67+ toPlace : PlaceHandler [ ] = [ ] ,
68+ toBreak : BreakHandler [ ] = [ ]
6769 ) : Move {
6870 // const p = new Map(prevMove.interactMap);
6971 // for (const breakH of toBreak) {
@@ -76,8 +78,8 @@ export class Move implements PathData {
7678 state . pos . x ,
7779 state . pos . y ,
7880 state . pos . z ,
79- // toPlace,
80- // toBreak,
81+ toPlace ,
82+ toBreak ,
8183 prevMove . remainingBlocks - 0 , //toPlace.length,
8284 cost ,
8385 type ,
@@ -96,8 +98,8 @@ export class Move implements PathData {
9698 pos : Vec3 ,
9799 prevMove : Move ,
98100 type : MovementProvider ,
99- // toPlace: PlaceHandler[] = [],
100- // toBreak: BreakHandler[] = []
101+ toPlace : PlaceHandler [ ] = [ ] ,
102+ toBreak : BreakHandler [ ] = [ ]
101103 ) : Move {
102104 // const p = new Map(prevMove.interactMap);
103105 // for (const place of toPlace) {
@@ -110,8 +112,8 @@ export class Move implements PathData {
110112 pos . x ,
111113 pos . y ,
112114 pos . z ,
113- // toPlace,
114- // toBreak,
115+ toPlace ,
116+ toBreak ,
115117 prevMove . remainingBlocks - 0 , //toPlace.length,
116118 cost ,
117119 type ,
0 commit comments