Fix BigDecimalAABB.

master
mckuhei 2 years ago
parent b28dcc5d83
commit 79942cf4ba

@ -5,6 +5,7 @@ import java.math.BigDecimal;
import org.mcmodule.math.BigInteger; import org.mcmodule.math.BigInteger;
import static java.math.BigDecimal.valueOf; import static java.math.BigDecimal.valueOf;
import static net.minecraft.src.MathHelper.normalize;
public class BigDecimalAABB public class BigDecimalAABB
{ {
@ -25,12 +26,12 @@ public class BigDecimalAABB
protected BigDecimalAABB(double par1, double par3, double par5, double par7, double par9, double par11) protected BigDecimalAABB(double par1, double par3, double par5, double par7, double par9, double par11)
{ {
this.minX = valueOf(par1); this.minX = valueOf(normalize(par1));
this.minY = par3; this.minY = par3;
this.minZ = valueOf(par5); this.minZ = valueOf(normalize(par5));
this.maxX = valueOf(par7); this.maxX = valueOf(normalize(par7));
this.maxY = par9; this.maxY = par9;
this.maxZ = valueOf(par11); this.maxZ = valueOf(normalize(par11));
} }
protected BigDecimalAABB(BigDecimal par1, double par3, BigDecimal par5, BigDecimal par7, double par9, BigDecimal par11) protected BigDecimalAABB(BigDecimal par1, double par3, BigDecimal par5, BigDecimal par7, double par9, BigDecimal par11)
@ -48,12 +49,12 @@ public class BigDecimalAABB
*/ */
public BigDecimalAABB setBounds(double par1, double par3, double par5, double par7, double par9, double par11) public BigDecimalAABB setBounds(double par1, double par3, double par5, double par7, double par9, double par11)
{ {
this.minX = valueOf(par1); this.minX = valueOf(normalize(par1));
this.minY = par3; this.minY = par3;
this.minZ = valueOf(par5); this.minZ = valueOf(normalize(par5));
this.maxX = valueOf(par7); this.maxX = valueOf(normalize(par7));
this.maxY = par9; this.maxY = par9;
this.maxZ = valueOf(par11); this.maxZ = valueOf(normalize(par11));
return this; return this;
} }
@ -75,7 +76,7 @@ public class BigDecimalAABB
* Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z * 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) { public BigDecimalAABB addCoord(double par1, double par3, double par5) {
return addCoord(valueOf(par1), par3, valueOf(par5)); return addCoord(valueOf(normalize(par1)), par3, valueOf(normalize(par5)));
} }
/** /**
@ -128,7 +129,7 @@ public class BigDecimalAABB
* y, z * y, z
*/ */
public BigDecimalAABB expand(double par1, double par3, double par5) { public BigDecimalAABB expand(double par1, double par3, double par5) {
return expand(valueOf(par1), par3, valueOf(par5)); return expand(valueOf(normalize(par1)), par3, valueOf(normalize(par5)));
} }
/** /**
@ -151,7 +152,7 @@ public class BigDecimalAABB
* y, z * y, z
*/ */
public BigDecimalAABB getOffsetBoundingBox(double par1, double par3, double par5) { public BigDecimalAABB getOffsetBoundingBox(double par1, double par3, double par5) {
return getOffsetBoundingBox(valueOf(par1), par3, valueOf(par5)); return getOffsetBoundingBox(valueOf(normalize(par1)), par3, valueOf(normalize(par5)));
} }
/** /**
@ -314,7 +315,7 @@ public class BigDecimalAABB
* Offsets the current bounding box by the specified coordinates. Args: x, y, z * Offsets the current bounding box by the specified coordinates. Args: x, y, z
*/ */
public BigDecimalAABB offset(double par1, double par3, double par5) { public BigDecimalAABB offset(double par1, double par3, double par5) {
return offset(valueOf(par1), par3, valueOf(par5)); return offset(valueOf(normalize(par1)), par3, valueOf(normalize(par5)));
} }
/** /**
@ -356,7 +357,7 @@ public class BigDecimalAABB
* Returns a bounding box that is inset by the specified amounts * Returns a bounding box that is inset by the specified amounts
*/ */
public BigDecimalAABB contract(double par1, double par3, double par5) { public BigDecimalAABB contract(double par1, double par3, double par5) {
return contract(valueOf(par1), par3, valueOf(par5)); return contract(valueOf(normalize(par1)), par3, valueOf(normalize(par5)));
} }
/** /**

Loading…
Cancel
Save