mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Merge pull request #155 from DemonWav/otherBlockPosFix
Add same infi-loop fix to other identical block of code I missed earlier
This commit is contained in:
commit
bba407aa46
1 changed files with 39 additions and 0 deletions
|
@ -47,4 +47,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
this.b = new BlockPosition(i, j, k);
|
||||
return this.b;
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
|
||||
protected BlockPosition.MutableBlockPosition a() {
|
||||
if (this.b == null) {
|
||||
- this.b = new BlockPosition.MutableBlockPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ this.b = new BlockPosition.MutableBlockPosition(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ()); // Paper - use blockposition2 instead of blockposition to prevent infinite loops
|
||||
return this.b;
|
||||
- } else if (this.b.equals(blockposition1)) {
|
||||
+ } else if (this.b.equals(blockposition3)) { // Paper - use blockposition3 instead of blockposition1 to prevent infinite loops
|
||||
return (BlockPosition.MutableBlockPosition) this.endOfData();
|
||||
} else {
|
||||
int i = this.b.getX();
|
||||
int j = this.b.getY();
|
||||
int k = this.b.getZ();
|
||||
|
||||
+ // Paper start - use blockposition2 and blockposition3 to prevent infinite loops
|
||||
+ /*
|
||||
if (i < blockposition1.getX()) {
|
||||
++i;
|
||||
} else if (j < blockposition1.getY()) {
|
||||
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
j = blockposition.getY();
|
||||
++k;
|
||||
}
|
||||
+ */
|
||||
+ if (i < blockposition3.getX()) {
|
||||
+ ++i;
|
||||
+ } else if (j < blockposition3.getY()) {
|
||||
+ i = blockposition2.getX();
|
||||
+ ++j;
|
||||
+ } else if (k < blockposition3.getZ()) {
|
||||
+ i = blockposition2.getX();
|
||||
+ j = blockposition2.getY();
|
||||
+ ++k;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
// Paper start - modify base position variables
|
||||
((BaseBlockPosition) this.b).a = i;
|
||||
--
|
Loading…
Reference in a new issue