Fixed entity colision above max world height, and below 0. Closes #400

This commit is contained in:
LexManos 2013-02-23 10:59:44 -08:00
parent d50f150c56
commit 3945819851

View file

@ -367,7 +367,7 @@
}
/**
@@ -1014,8 +1121,8 @@
@@ -1014,17 +1121,25 @@
*/
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List)
{
@ -378,7 +378,24 @@
if (var4 < 0)
{
@@ -1062,8 +1169,8 @@
var4 = 0;
}
+ else if (var4 >= this.entityLists.length) //BugFix: Collision above the world
+ {
+ var4 = this.entityLists.length - 1;
+ }
if (var5 >= this.entityLists.length)
{
var5 = this.entityLists.length - 1;
+ }
+ else if (var5 < 0) //BugFix: Collision below the world
+ {
+ var5 = 0;
}
for (int var6 = var4; var6 <= var5; ++var6)
@@ -1062,8 +1177,8 @@
*/
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
@ -389,7 +406,7 @@
if (var5 < 0)
{
@@ -1246,6 +1353,15 @@
@@ -1246,6 +1361,15 @@
*/
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
{
@ -405,7 +422,7 @@
int var5 = 0;
boolean var6 = !this.worldObj.provider.hasNoSky;
int var7;
@@ -1346,12 +1462,26 @@
@@ -1346,12 +1470,26 @@
}
this.generateHeightMap();
@ -438,7 +455,7 @@
}
}
@@ -1460,4 +1590,18 @@
@@ -1460,4 +1598,18 @@
}
}
}