@@ -58,15 +58,14 @@ public PathEntity doPathSearch(ChunkCache chunkcache, BlockPosition blockpositio
58
58
public PathEntity doPathSearch (ChunkCache chunkcache , int x , int y , int z ) {
59
59
if (this .b ()) {
60
60
float f = this .i ();
61
- return this .j .a ((IBlockAccess ) chunkcache , (Entity ) this .b , x , y , z , f );
61
+ return this .j .a ((IBlockAccess ) chunkcache , (Entity ) this .b , new BlockPosition ( x , y , z ) , f );
62
62
}
63
63
return null ;
64
64
}
65
65
66
66
public PathEntity doPathSearch (ChunkCache chunkcache , Entity entity ) {
67
- //return this.doPathSearch(chunkcache, (new BlockPosition(entity)).up());
68
- return this .doPathSearch (chunkcache , MathHelper .floor (entity .locX ), MathHelper .floor (entity .locY ) + 1 ,
69
- MathHelper .floor (entity .locZ ));
67
+ return this .doPathSearch (chunkcache , (new BlockPosition (entity )).up ());
68
+
70
69
}
71
70
// WindSpigot end
72
71
@@ -88,27 +87,7 @@ public PathEntity a(double d0, double d1, double d2) {
88
87
}
89
88
90
89
public PathEntity a (int d0 , int d1 , int d2 ) { // remove final modifier
91
- //return this.a(new BlockPosition(MathHelper.floor(d0), (int) d1, MathHelper.floor(d2)));
92
- // debug msgs
93
- WindSpigot .debug ("Executing sync path search..." );
94
- if (!this .b ()) {
95
- return null ;
96
- } else {
97
- float f = this .i ();
98
-
99
- this .c .methodProfiler .a ("pathfind" );
100
-
101
- int i = (int ) (f + 8.0F );
102
-
103
- ChunkCache chunkcache = new ChunkCache (this .c , MathHelper .floor (b .locX ) - i , MathHelper .floor (b .locY ) - i ,
104
- MathHelper .floor (b .locZ ) - i , MathHelper .floor (b .locX ) + i , MathHelper .floor (b .locY ) + i ,
105
- MathHelper .floor (b .locZ ) + i , 0 );
106
-
107
- PathEntity pathentity = this .j .a (chunkcache , this .b , d0 , d1 , d2 , f );
108
-
109
- this .c .methodProfiler .b ();
110
- return pathentity ;
111
- }
90
+ return this .a (new BlockPosition (MathHelper .floor (d0 ), (int ) d1 , MathHelper .floor (d2 )));
112
91
}
113
92
// WindSpigot end
114
93
@@ -119,15 +98,10 @@ public PathEntity a(BlockPosition blockposition) {
119
98
float f = this .i ();
120
99
121
100
this .c .methodProfiler .a ("pathfind" );
122
- // WindSpigot start - reduce usage of blockposition
123
- //BlockPosition blockposition1 = new BlockPosition(this.b);
101
+ BlockPosition blockposition1 = new BlockPosition (this .b );
124
102
int i = (int ) (f + 8.0F );
125
- //ChunkCache chunkcache = new ChunkCache(this.c, blockposition1.a(-i, -i, -i), blockposition1.a(i, i, i), 0);
126
-
127
- ChunkCache chunkcache = new ChunkCache (this .c , MathHelper .floor (b .locX - i ), MathHelper .floor (b .locY - i ),
128
- MathHelper .floor (b .locZ - i ), MathHelper .floor (b .locX + i ), MathHelper .floor (b .locY + i ),
129
- MathHelper .floor (b .locZ + i ), 0 );
130
- // WindSpigot end
103
+ ChunkCache chunkcache = new ChunkCache (this .c , blockposition1 .a (-i , -i , -i ), blockposition1 .a (i , i , i ), 0 );
104
+
131
105
132
106
PathEntity pathentity = this .j .a (chunkcache , this .b , blockposition , f );
133
107
0 commit comments