Change RenderList to BigDecimal.

master
mckuhei 2 years ago
parent 0dac8eae26
commit e22d379ad7

@ -0,0 +1,538 @@
package net.minecraft.src;
import java.math.BigDecimal;
import org.mcmodule.math.BigInteger;
import static java.math.BigDecimal.valueOf;
public class BigDecimalAABB
{
public BigDecimal minX;
public double minY;
public BigDecimal minZ;
public BigDecimal maxX;
public double maxY;
public BigDecimal maxZ;
/**
* Returns a bounding box with the specified bounds. Args: minX, minY, minZ, maxX, maxY, maxZ
*/
public static BigDecimalAABB getBoundingBox(double par0, double par2, double par4, double par6, double par8, double par10)
{
return new BigDecimalAABB(par0, par2, par4, par6, par8, par10);
}
protected BigDecimalAABB(double par1, double par3, double par5, double par7, double par9, double par11)
{
this.minX = valueOf(par1);
this.minY = par3;
this.minZ = valueOf(par5);
this.maxX = valueOf(par7);
this.maxY = par9;
this.maxZ = valueOf(par11);
}
protected BigDecimalAABB(BigDecimal par1, double par3, BigDecimal par5, BigDecimal par7, double par9, BigDecimal par11)
{
this.minX = par1;
this.minY = par3;
this.minZ = par5;
this.maxX = par7;
this.maxY = par9;
this.maxZ = par11;
}
/**
* Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ
*/
public BigDecimalAABB setBounds(double par1, double par3, double par5, double par7, double par9, double par11)
{
this.minX = valueOf(par1);
this.minY = par3;
this.minZ = valueOf(par5);
this.maxX = valueOf(par7);
this.maxY = par9;
this.maxZ = valueOf(par11);
return this;
}
/**
* Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ
*/
public BigDecimalAABB setBounds(BigDecimal par1, double par3, BigDecimal par5, BigDecimal par7, double par9, BigDecimal par11)
{
this.minX = par1;
this.minY = par3;
this.minZ = par5;
this.maxX = par7;
this.maxY = par9;
this.maxZ = par11;
return this;
}
/**
* Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z
*/
public BigDecimalAABB addCoord(double par1, double par3, double par5) {
return addCoord(valueOf(par1), par3, valueOf(par5));
}
/**
* Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z
*/
public BigDecimalAABB addCoord(BigDecimal par1, double par3, BigDecimal par5)
{
BigDecimal var7 = this.minX;
double var9 = this.minY;
BigDecimal var11 = this.minZ;
BigDecimal var13 = this.maxX;
double var15 = this.maxY;
BigDecimal var17 = this.maxZ;
if (par1.signum() == -1)
{
var7 = var7.add(par1);
}
if (par1.signum() == 1)
{
var13 = var13.add(par1);
}
if (par3 < 0.0)
{
var9 += par3;
}
if (par3 > 0.0D)
{
var15 += par3;
}
if (par5.signum() == -1)
{
var11 = var11.add(par5);
}
if (par5.signum() == 1)
{
var17 = var17.add(par5);
}
return new BigDecimalAABB(var7, var9, var11, var13, var15, var17);
}
/**
* Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x,
* y, z
*/
public BigDecimalAABB expand(double par1, double par3, double par5) {
return expand(valueOf(par1), par3, valueOf(par5));
}
/**
* Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x,
* y, z
*/
public BigDecimalAABB expand(BigDecimal par1, double par3, BigDecimal par5)
{
BigDecimal var7 = this.minX.subtract(par1);
double var9 = this.minY - par3;
BigDecimal var11 = this.minZ.subtract(par5);
BigDecimal var13 = this.maxX.add(par1);
double var15 = this.maxY + par3;
BigDecimal var17 = this.maxZ.add(par5);
return new BigDecimalAABB(var7, var9, var11, var13, var15, var17);
}
/**
* Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x,
* y, z
*/
public BigDecimalAABB getOffsetBoundingBox(double par1, double par3, double par5) {
return getOffsetBoundingBox(valueOf(par1), par3, valueOf(par5));
}
/**
* Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x,
* y, z
*/
public BigDecimalAABB getOffsetBoundingBox(BigDecimal par1, double par3, BigDecimal par5)
{
return new BigDecimalAABB(this.minX.add(par1), this.minY + par3, this.minZ.add(par5), this.maxX.add(par1), this.maxY + par3, this.maxZ.add(par5));
}
/**
* if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them
* in the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the
* calculated offset. Otherwise return the calculated offset.
*/
public double calculateXOffset(BigDecimalAABB par1AxisAlignedBB, double par2)
{
if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY)
{
if (par1AxisAlignedBB.maxZ.compareTo(this.minZ) > 0 && par1AxisAlignedBB.minZ.compareTo(this.maxZ) < 0)
{
double var4;
if (par2 > 0 && par1AxisAlignedBB.maxX.compareTo(this.minX) <= 0)
{
var4 = this.minX.subtract(par1AxisAlignedBB.maxX).doubleValue();
if (var4 < par2)
{
par2 = var4;
}
}
if (par2 < 0 && par1AxisAlignedBB.minX.compareTo(this.maxX) >= 0)
{
var4 = this.maxX.subtract(par1AxisAlignedBB.minX).doubleValue();
if (var4 > par2)
{
par2 = var4;
}
}
return par2;
}
else
{
return par2;
}
}
else
{
return par2;
}
}
/**
* if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them
* in the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the
* calculated offset. Otherwise return the calculated offset.
*/
public double calculateYOffset(BigDecimalAABB par1AxisAlignedBB, double par2)
{
if (par1AxisAlignedBB.maxX.compareTo(this.minX) > 0 && par1AxisAlignedBB.minX.compareTo(this.maxX) < 0)
{
if (par1AxisAlignedBB.maxZ.compareTo(this.minZ) > 0 && par1AxisAlignedBB.minZ.compareTo(this.maxZ) < 0)
{
double var4;
if (par2 > 0.0D && par1AxisAlignedBB.maxY <= this.minY)
{
var4 = this.minY - par1AxisAlignedBB.maxY;
if (var4 < par2)
{
par2 = var4;
}
}
if (par2 < 0.0D && par1AxisAlignedBB.minY >= this.maxY)
{
var4 = this.maxY - par1AxisAlignedBB.minY;
if (var4 > par2)
{
par2 = var4;
}
}
return par2;
}
else
{
return par2;
}
}
else
{
return par2;
}
}
/**
* if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them
* in the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the
* calculated offset. Otherwise return the calculated offset.
*/
public double calculateZOffset(BigDecimalAABB par1AxisAlignedBB, double par2)
{
if (par1AxisAlignedBB.maxX.compareTo(this.minX) > 0 && par1AxisAlignedBB.minX.compareTo(this.maxX) < 0)
{
if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY)
{
double var4;
if (par2 > 0.0D && par1AxisAlignedBB.maxZ.compareTo(this.minZ) <= 0)
{
var4 = this.minZ.subtract(par1AxisAlignedBB.maxZ).doubleValue();
if (var4 < par2)
{
par2 = var4;
}
}
if (par2 < 0.0D && par1AxisAlignedBB.minZ.compareTo(this.maxZ) >= 0)
{
var4 = this.maxZ.subtract(par1AxisAlignedBB.minZ).doubleValue();
if (var4 > par2)
{
par2 = var4;
}
}
return par2;
}
else
{
return par2;
}
}
else
{
return par2;
}
}
/**
* Returns whether the given bounding box intersects with this one. Args: axisAlignedBB
*/
public boolean intersectsWith(BigDecimalAABB par1AxisAlignedBB)
{
return par1AxisAlignedBB.maxX.compareTo(this.minX) > 0 && par1AxisAlignedBB.minX.compareTo(this.maxX) < 0 ? (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY ? par1AxisAlignedBB.maxZ.compareTo(this.minZ) > 0 && par1AxisAlignedBB.minZ.compareTo(this.maxZ) < 0 : false) : false;
}
/**
* Offsets the current bounding box by the specified coordinates. Args: x, y, z
*/
public BigDecimalAABB offset(double par1, double par3, double par5) {
return offset(valueOf(par1), par3, valueOf(par5));
}
/**
* Offsets the current bounding box by the specified coordinates. Args: x, y, z
*/
public BigDecimalAABB offset(BigDecimal par1, double par3, BigDecimal par5)
{
this.minX = minX.add(par1);
this.minY += par3;
this.minZ = minZ.add(par5);
this.maxX = maxX.add(par1);
this.maxY += par3;
this.maxZ = maxZ.add(par5);
return this;
}
/**
* Returns if the supplied Vec3D is completely inside the bounding box
*/
public boolean isVecInside(Vec3 par1Vec3)
{
BigDecimal x = valueOf(par1Vec3.xCoord),
z = valueOf(par1Vec3.zCoord);
return x.compareTo(this.minX) > 0 && x.compareTo(this.maxX) < 0 ? (par1Vec3.yCoord > this.minY && par1Vec3.yCoord < this.maxY ? z.compareTo(this.minZ) > 0 && z.compareTo(this.maxZ) < 0 : false) : false;
}
/**
* Returns the average length of the edges of the bounding box.
*/
public double getAverageEdgeLength()
{
double var1 = this.maxX.subtract(this.minX).doubleValue();
double var3 = this.maxY - this.minY;
double var5 = this.maxZ.subtract(this.minZ).doubleValue();
return (var1 + var3 + var5) / 3.0D;
}
/**
* Returns a bounding box that is inset by the specified amounts
*/
public BigDecimalAABB contract(double par1, double par3, double par5) {
return contract(valueOf(par1), par3, valueOf(par5));
}
/**
* Returns a bounding box that is inset by the specified amounts
*/
public BigDecimalAABB contract(BigDecimal par1, double par3, BigDecimal par5)
{
BigDecimal var7 = this.minX.add(par1);
double var9 = this.minY + par3;
BigDecimal var11 = this.minZ.add(par5);
BigDecimal var13 = this.maxX.subtract(par1);
double var15 = this.maxY - par3;
BigDecimal var17 = this.maxZ.subtract(par5);
return new BigDecimalAABB(var7, var9, var11, var13, var15, var17);
}
/**
* Returns a copy of the bounding box.
*/
public BigDecimalAABB copy()
{
return new BigDecimalAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
}
// public MovingObjectPosition calculateIntercept(Vec3 par1Vec3, Vec3 par2Vec3)
// {
// Vec3 var3 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.minX);
// Vec3 var4 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.maxX);
// Vec3 var5 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.minY);
// Vec3 var6 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.maxY);
// Vec3 var7 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.minZ);
// Vec3 var8 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.maxZ);
//
// if (!this.isVecInYZ(var3))
// {
// var3 = null;
// }
//
// if (!this.isVecInYZ(var4))
// {
// var4 = null;
// }
//
// if (!this.isVecInXZ(var5))
// {
// var5 = null;
// }
//
// if (!this.isVecInXZ(var6))
// {
// var6 = null;
// }
//
// if (!this.isVecInXY(var7))
// {
// var7 = null;
// }
//
// if (!this.isVecInXY(var8))
// {
// var8 = null;
// }
//
// Vec3 var9 = null;
//
// if (var3 != null && (var9 == null || par1Vec3.squareDistanceTo(var3) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var3;
// }
//
// if (var4 != null && (var9 == null || par1Vec3.squareDistanceTo(var4) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var4;
// }
//
// if (var5 != null && (var9 == null || par1Vec3.squareDistanceTo(var5) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var5;
// }
//
// if (var6 != null && (var9 == null || par1Vec3.squareDistanceTo(var6) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var6;
// }
//
// if (var7 != null && (var9 == null || par1Vec3.squareDistanceTo(var7) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var7;
// }
//
// if (var8 != null && (var9 == null || par1Vec3.squareDistanceTo(var8) < par1Vec3.squareDistanceTo(var9)))
// {
// var9 = var8;
// }
//
// if (var9 == null)
// {
// return null;
// }
// else
// {
// byte var10 = -1;
//
// if (var9 == var3)
// {
// var10 = 4;
// }
//
// if (var9 == var4)
// {
// var10 = 5;
// }
//
// if (var9 == var5)
// {
// var10 = 0;
// }
//
// if (var9 == var6)
// {
// var10 = 1;
// }
//
// if (var9 == var7)
// {
// var10 = 2;
// }
//
// if (var9 == var8)
// {
// var10 = 3;
// }
//
// return new MovingObjectPosition(BigInteger.ONE, 0, BigInteger.ONE, var10, var9);
// }
// }
//
// /**
// * Checks if the specified vector is within the YZ dimensions of the bounding box. Args: Vec3D
// */
// private boolean isVecInYZ(Vec3 par1Vec3)
// {
// return par1Vec3 == null ? false : par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ;
// }
//
// /**
// * Checks if the specified vector is within the XZ dimensions of the bounding box. Args: Vec3D
// */
// private boolean isVecInXZ(Vec3 par1Vec3)
// {
// return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ;
// }
//
// /**
// * Checks if the specified vector is within the XY dimensions of the bounding box. Args: Vec3D
// */
// private boolean isVecInXY(Vec3 par1Vec3)
// {
// return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY;
// }
/**
* Sets the bounding box to the same bounds as the bounding box passed in. Args: axisAlignedBB
*/
public void setBB(BigDecimalAABB par1AxisAlignedBB)
{
this.minX = par1AxisAlignedBB.minX;
this.minY = par1AxisAlignedBB.minY;
this.minZ = par1AxisAlignedBB.minZ;
this.maxX = par1AxisAlignedBB.maxX;
this.maxY = par1AxisAlignedBB.maxY;
this.maxZ = par1AxisAlignedBB.maxZ;
}
public String toString()
{
return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + this.maxZ + "]";
}
}

@ -0,0 +1,5 @@
package net.minecraft.src;
public class Constants {
}

@ -1,6 +1,8 @@
package net.minecraft.src;
import org.mcmodule.math.BigInteger;
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.List;
@ -108,10 +110,13 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
protected float speedOnGround = 0.1F;
protected float speedInAir = 0.02F;
protected BigDecimalAABB boundingBox = BigDecimalAABB.getBoundingBox(0, 0, 0, 0, 0, 0);
/**
* An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different
*/
public EntityFishHook fishEntity = null;
public BigDecimal posXBig, posZBig;
public EntityPlayer(World par1World)
{
@ -516,7 +521,7 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
if (this.getHealth() > 0)
{
List var3 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(1.0D, 0.0D, 1.0D));
List var3 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, super.boundingBox.expand(1.0D, 0.0D, 1.0D));
if (var3 != null)
{
@ -576,6 +581,271 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
this.addStat(StatList.deathsStat, 1);
}
@Override
public void setPosition(double x, double y, double z) {
super.setPosition(x, y, z);
float var7 = this.width / 2.0F;
float var8 = this.height;
if(this.boundingBox == null) this.boundingBox = BigDecimalAABB.getBoundingBox(0, 0, 0, 0, 0, 0);
this.boundingBox.setBounds(x - (double)var7, y - (double)this.yOffset + (double)this.ySize, z - (double)var7, x + (double)var7, y - (double)this.yOffset + (double)this.ySize + (double)var8, z + (double)var7);
}
public void moveEntity(double par1, double par3, double par5)
{
super.moveEntity(par1, par3, par5);
if (this.noClip)
{
this.boundingBox.offset(par1, par3, par5);
this.posXBig = (this.boundingBox.minX.add(this.boundingBox.maxX)).divide(BigDecimal.valueOf(2));
this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize;
this.posZBig = (this.boundingBox.minZ.add(this.boundingBox.maxZ)).divide(BigDecimal.valueOf(2));
}
else
{
this.worldObj.theProfiler.startSection("move");
this.ySize *= 0.4F;
double var7 = this.posX;
double var9 = this.posZ;
if (this.isInWeb)
{
this.isInWeb = false;
par1 *= 0.25D;
par3 *= 0.05000000074505806D;
par5 *= 0.25D;
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
}
double var11 = par1;
double var13 = par3;
double var15 = par5;
BigDecimalAABB var17 = this.boundingBox.copy();
boolean var18 = this.onGround && this.isSneaking() && this instanceof EntityPlayer;
if (var18)
{
double var19;
for (var19 = 0.05D; par1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, super.boundingBox.getOffsetBoundingBox(par1, -1.0D, 0.0D)).isEmpty(); var11 = par1)
{
if (par1 < var19 && par1 >= -var19)
{
par1 = 0.0D;
}
else if (par1 > 0.0D)
{
par1 -= var19;
}
else
{
par1 += var19;
}
}
for (; par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, super.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, par5)).isEmpty(); var15 = par5)
{
if (par5 < var19 && par5 >= -var19)
{
par5 = 0.0D;
}
else if (par5 > 0.0D)
{
par5 -= var19;
}
else
{
par5 += var19;
}
}
while (par1 != 0.0D && par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, super.boundingBox.getOffsetBoundingBox(par1, -1.0D, par5)).isEmpty())
{
if (par1 < var19 && par1 >= -var19)
{
par1 = 0.0D;
}
else if (par1 > 0.0D)
{
par1 -= var19;
}
else
{
par1 += var19;
}
if (par5 < var19 && par5 >= -var19)
{
par5 = 0.0D;
}
else if (par5 > 0.0D)
{
par5 -= var19;
}
else
{
par5 += var19;
}
var11 = par1;
var15 = par5;
}
}
List var30 = this.worldObj.getCollidingBoundingBoxes(this, super.boundingBox.addCoord(par1, par3, par5));
AxisAlignedBB var21;
for (Iterator var20 = var30.iterator(); var20.hasNext(); par3 = var21.calculateYOffset(super.boundingBox, par3))
{
var21 = (AxisAlignedBB)var20.next();
}
this.boundingBox.offset(0.0D, par3, 0.0D);
if (!this.field_70135_K && var13 != par3)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
boolean var31 = this.onGround || var13 != par3 && var13 < 0.0D;
AxisAlignedBB var22;
Iterator var32;
for (var32 = var30.iterator(); var32.hasNext(); par1 = var22.calculateXOffset(super.boundingBox, par1))
{
var22 = (AxisAlignedBB)var32.next();
}
this.boundingBox.offset(par1, 0.0D, 0.0D);
if (!this.field_70135_K && var11 != par1)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
for (var32 = var30.iterator(); var32.hasNext(); par5 = var22.calculateZOffset(super.boundingBox, par5))
{
var22 = (AxisAlignedBB)var32.next();
}
this.boundingBox.offset(0.0D, 0.0D, par5);
if (!this.field_70135_K && var15 != par5)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
double var23;
double var33;
if (this.stepHeight > 0.0F && var31 && (var18 || this.ySize < 0.05F) && (var11 != par1 || var15 != par5))
{
var33 = par1;
var23 = par3;
double var25 = par5;
par1 = var11;
par3 = (double)this.stepHeight;
par5 = var15;
BigDecimalAABB var27 = this.boundingBox.copy();
this.boundingBox.setBB(var17);
var30 = this.worldObj.getCollidingBoundingBoxes(this, super.boundingBox.addCoord(var11, par3, var15));
Iterator var28;
AxisAlignedBB var29;
for (var28 = var30.iterator(); var28.hasNext(); par3 = var29.calculateYOffset(super.boundingBox, par3))
{
var29 = (AxisAlignedBB)var28.next();
}
this.boundingBox.offset(0.0D, par3, 0.0D);
if (!this.field_70135_K && var13 != par3)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
for (var28 = var30.iterator(); var28.hasNext(); par1 = var29.calculateXOffset(super.boundingBox, par1))
{
var29 = (AxisAlignedBB)var28.next();
}
this.boundingBox.offset(par1, 0.0D, 0.0D);
if (!this.field_70135_K && var11 != par1)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
for (var28 = var30.iterator(); var28.hasNext(); par5 = var29.calculateZOffset(super.boundingBox, par5))
{
var29 = (AxisAlignedBB)var28.next();
}
this.boundingBox.offset(0.0D, 0.0D, par5);
if (!this.field_70135_K && var15 != par5)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
if (!this.field_70135_K && var13 != par3)
{
par5 = 0.0D;
par3 = 0.0D;
par1 = 0.0D;
}
else
{
par3 = (double)(-this.stepHeight);
for (var28 = var30.iterator(); var28.hasNext(); par3 = var29.calculateYOffset(super.boundingBox, par3))
{
var29 = (AxisAlignedBB)var28.next();
}
this.boundingBox.offset(0.0D, par3, 0.0D);
}
if (var33 * var33 + var25 * var25 >= par1 * par1 + par5 * par5)
{
par1 = var33;
par3 = var23;
par5 = var25;
this.boundingBox.setBB(var27);
}
else
{
double var37 = this.boundingBox.minY - (double)((int)this.boundingBox.minY);
if (var37 > 0.0D)
{
this.ySize = (float)((double)this.ySize + var37 + 0.01D);
}
}
}
// TODO: Fix offset
BigDecimal offset = BigDecimal.valueOf(0.5);
this.posXBig = (this.boundingBox.minX.add(this.boundingBox.maxX)).divide(BigDecimal.valueOf(2)).add(offset);
this.posZBig = (this.boundingBox.minZ.add(this.boundingBox.maxZ)).divide(BigDecimal.valueOf(2)).add(offset);
this.worldObj.theProfiler.endSection();
}
}
/**
* Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args:
* entity, scoreToAdd

@ -44,7 +44,7 @@ public class ItemBoat extends Item
Vec3 var25 = par3EntityPlayer.getLook(var4);
boolean var26 = false;
float var27 = 1.0F;
List var28 = par2World.getEntitiesWithinAABBExcludingEntity(par3EntityPlayer, par3EntityPlayer.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27));
List var28 = par2World.getEntitiesWithinAABBExcludingEntity(par3EntityPlayer, ((Entity)par3EntityPlayer).boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27));
Iterator var29 = var28.iterator();
while (var29.hasNext())

@ -81,6 +81,10 @@ public class MathHelper
return new BigInteger(String.format("%.0f", val));
}
public static BigDecimal toBigDecimal(BigInteger val) {
return new BigDecimal(new java.math.BigInteger(val.toByteArray()));
}
public static float abs(float par0)
{
return par0 >= 0.0F ? par0 : -par0;

@ -271,7 +271,7 @@ public class NetServerHandler extends NetHandler
}
float var27 = 0.0625F;
boolean var28 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty();
boolean var28 = var2.getCollidingBoundingBoxes(this.playerEntity, ((Entity)this.playerEntity).boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty();
if (this.playerEntity.onGround && !par1Packet10Flying.onGround && var15 > 0.0D)
{
@ -301,7 +301,7 @@ public class NetServerHandler extends NetHandler
}
this.playerEntity.setPositionAndRotation(var5, var7, var9, var11, var12);
boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty();
boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, ((Entity)this.playerEntity).boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty();
if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping())
{
@ -309,7 +309,7 @@ public class NetServerHandler extends NetHandler
return;
}
AxisAlignedBB var33 = this.playerEntity.boundingBox.copy().expand((double)var27, (double)var27, (double)var27).addCoord(0.0D, -0.55D, 0.0D);
AxisAlignedBB var33 = ((Entity)this.playerEntity).boundingBox.copy().expand((double)var27, (double)var27, (double)var27).addCoord(0.0D, -0.55D, 0.0D);
if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.isAABBNonEmpty(var33))
{

@ -1,6 +1,8 @@
package net.minecraft.src;
import org.mcmodule.math.BigInteger;
import java.math.BigDecimal;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.Arrays;
@ -800,10 +802,10 @@ public class RenderGlobal implements IWorldAccess
}
}
EntityLiving var19 = this.mc.renderViewEntity;
double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * par4;
double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * par4;
double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * par4;
EntityPlayer var19 = (EntityPlayer) this.mc.renderViewEntity;
// double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * par4;
// double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * par4;
// double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * par4;
int var14 = 0;
RenderList[] var15 = this.allRenderLists;
int var16 = var15.length;
@ -833,7 +835,7 @@ public class RenderGlobal implements IWorldAccess
if (var17 < 0)
{
var17 = var14++;
this.allRenderLists[var17].func_78422_a(var22.posXMinus, var22.posYMinus, var22.posZMinus, var20, var10, var12);
this.allRenderLists[var17].func_78422_a(var22.posXMinus, var22.posYMinus, var22.posZMinus, var19.posXBig == null ? BigDecimal.ZERO : var19.posXBig, var19.posY, var19.posZBig == null ? BigDecimal.ZERO : var19.posZBig);
}
}

@ -1,6 +1,8 @@
package net.minecraft.src;
import org.mcmodule.math.BigInteger;
import java.math.BigDecimal;
import java.nio.IntBuffer;
import org.lwjgl.opengl.GL11;
@ -9,14 +11,14 @@ public class RenderList
private BigInteger field_78429_a;
private int field_78427_b;
private BigInteger field_78428_c;
private double field_78425_d;
private BigDecimal field_78425_d;
private double field_78426_e;
private double field_78423_f;
private BigDecimal field_78423_f;
private IntBuffer field_78424_g = GLAllocation.createDirectIntBuffer(65536);
private boolean field_78430_h = false;
private boolean field_78431_i = false;
public void func_78422_a(BigInteger par1, int par2, BigInteger par3, double par4, double par6, double par8)
public void func_78422_a(BigInteger par1, int par2, BigInteger par3, BigDecimal par4, double par6, BigDecimal par8)
{
this.field_78430_h = true;
this.field_78424_g.clear();
@ -56,7 +58,7 @@ public class RenderList
if (this.field_78424_g.remaining() > 0)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)((double)this.field_78429_a.doubleValue() - this.field_78425_d), (float)((double)this.field_78427_b - this.field_78426_e), (float)((double)this.field_78428_c.doubleValue() - this.field_78423_f));
GL11.glTranslatef((float)(MathHelper.toBigDecimal(this.field_78429_a).subtract(this.field_78425_d).floatValue()), (float)((double)this.field_78427_b - this.field_78426_e), (float)(MathHelper.toBigDecimal(this.field_78428_c).subtract(this.field_78423_f).floatValue()));
GL11.glCallLists(this.field_78424_g);
GL11.glPopMatrix();
}

@ -145,7 +145,7 @@ public abstract class ServerConfigurationManager
this.playerEntityList.add(par1EntityPlayerMP);
WorldServer var2 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
while (!var2.getCollidingBoundingBoxes(par1EntityPlayerMP, par1EntityPlayerMP.boundingBox).isEmpty())
while (!var2.getCollidingBoundingBoxes(par1EntityPlayerMP, ((Entity)par1EntityPlayerMP).boundingBox).isEmpty())
{
par1EntityPlayerMP.setPosition(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY + 1.0D, par1EntityPlayerMP.posZ);
}
@ -313,7 +313,7 @@ public abstract class ServerConfigurationManager
var7.theChunkProviderServer.loadChunk(MathHelper.toBigInteger(var6.posX).shiftRight(4), MathHelper.toBigInteger(var6.posZ).shiftRight(4));
while (!var7.getCollidingBoundingBoxes(var6, var6.boundingBox).isEmpty())
while (!var7.getCollidingBoundingBoxes(var6, ((Entity)var6).boundingBox).isEmpty())
{
var6.setPosition(var6.posX, var6.posY + 1.0D, var6.posZ);
}

Loading…
Cancel
Save